1/*
2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 *    notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 *    notice, this list of conditions and the following disclaimer in the
11 *    documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#ifndef GraphicsLayer_h
27#define GraphicsLayer_h
28
29#if USE(ACCELERATED_COMPOSITING)
30
31#include "Animation.h"
32#include "Color.h"
33#include "FloatPoint.h"
34#include "FloatPoint3D.h"
35#include "FloatSize.h"
36#include "GraphicsLayerClient.h"
37#include "IntRect.h"
38#include "PlatformLayer.h"
39#include "TransformOperations.h"
40#include <wtf/OwnPtr.h>
41#include <wtf/PassOwnPtr.h>
42
43#if ENABLE(CSS_FILTERS)
44#include "FilterOperations.h"
45#endif
46
47enum LayerTreeAsTextBehaviorFlags {
48    LayerTreeAsTextBehaviorNormal = 0,
49    LayerTreeAsTextDebug = 1 << 0, // Dump extra debugging info like layer addresses.
50    LayerTreeAsTextIncludeVisibleRects = 1 << 1,
51    LayerTreeAsTextIncludeTileCaches = 1 << 2,
52    LayerTreeAsTextIncludeRepaintRects = 1 << 3,
53    LayerTreeAsTextIncludePaintingPhases = 1 << 4
54};
55typedef unsigned LayerTreeAsTextBehavior;
56
57namespace WebCore {
58
59class FloatRect;
60class GraphicsContext;
61class GraphicsLayerFactory;
62class Image;
63class TextStream;
64class TiledBacking;
65class TimingFunction;
66class TransformationMatrix;
67
68// Base class for animation values (also used for transitions). Here to
69// represent values for properties being animated via the GraphicsLayer,
70// without pulling in style-related data from outside of the platform directory.
71// FIXME: Should be moved to its own header file.
72class AnimationValue {
73    WTF_MAKE_FAST_ALLOCATED;
74public:
75    virtual ~AnimationValue() { }
76
77    float keyTime() const { return m_keyTime; }
78    const TimingFunction* timingFunction() const { return m_timingFunction.get(); }
79    virtual PassOwnPtr<AnimationValue> clone() const = 0;
80
81protected:
82    AnimationValue(float keyTime, PassRefPtr<TimingFunction> timingFunction = 0)
83        : m_keyTime(keyTime)
84        , m_timingFunction(timingFunction)
85    {
86    }
87
88private:
89    float m_keyTime;
90    RefPtr<TimingFunction> m_timingFunction;
91};
92
93// Used to store one float value of an animation.
94// FIXME: Should be moved to its own header file.
95class FloatAnimationValue : public AnimationValue {
96public:
97    static PassOwnPtr<FloatAnimationValue> create(float keyTime, float value, PassRefPtr<TimingFunction> timingFunction = 0)
98    {
99        return adoptPtr(new FloatAnimationValue(keyTime, value, timingFunction));
100    }
101
102    virtual PassOwnPtr<AnimationValue> clone() const OVERRIDE
103    {
104        return adoptPtr(new FloatAnimationValue(*this));
105    }
106
107    float value() const { return m_value; }
108
109private:
110    FloatAnimationValue(float keyTime, float value, PassRefPtr<TimingFunction> timingFunction)
111        : AnimationValue(keyTime, timingFunction)
112        , m_value(value)
113    {
114    }
115
116    float m_value;
117};
118
119// Used to store one transform value in a keyframe list.
120// FIXME: Should be moved to its own header file.
121class TransformAnimationValue : public AnimationValue {
122public:
123    static PassOwnPtr<TransformAnimationValue> create(float keyTime, const TransformOperations& value, PassRefPtr<TimingFunction> timingFunction = 0)
124    {
125        return adoptPtr(new TransformAnimationValue(keyTime, value, timingFunction));
126    }
127
128    virtual PassOwnPtr<AnimationValue> clone() const OVERRIDE
129    {
130        return adoptPtr(new TransformAnimationValue(*this));
131    }
132
133    const TransformOperations& value() const { return m_value; }
134
135private:
136    TransformAnimationValue(float keyTime, const TransformOperations& value, PassRefPtr<TimingFunction> timingFunction)
137        : AnimationValue(keyTime, timingFunction)
138        , m_value(value)
139    {
140    }
141
142    TransformOperations m_value;
143};
144
145#if ENABLE(CSS_FILTERS)
146// Used to store one filter value in a keyframe list.
147// FIXME: Should be moved to its own header file.
148class FilterAnimationValue : public AnimationValue {
149public:
150    static PassOwnPtr<FilterAnimationValue> create(float keyTime, const FilterOperations& value, PassRefPtr<TimingFunction> timingFunction = 0)
151    {
152        return adoptPtr(new FilterAnimationValue(keyTime, value, timingFunction));
153    }
154
155    virtual PassOwnPtr<AnimationValue> clone() const OVERRIDE
156    {
157        return adoptPtr(new FilterAnimationValue(*this));
158    }
159
160    const FilterOperations& value() const { return m_value; }
161
162private:
163    FilterAnimationValue(float keyTime, const FilterOperations& value, PassRefPtr<TimingFunction> timingFunction)
164        : AnimationValue(keyTime, timingFunction)
165        , m_value(value)
166    {
167    }
168
169    FilterOperations m_value;
170};
171#endif
172
173// Used to store a series of values in a keyframe list.
174// Values will all be of the same type, which can be inferred from the property.
175// FIXME: Should be moved to its own header file.
176class KeyframeValueList {
177public:
178    explicit KeyframeValueList(AnimatedPropertyID property)
179        : m_property(property)
180    {
181    }
182
183    KeyframeValueList(const KeyframeValueList& other)
184        : m_property(other.property())
185    {
186        for (size_t i = 0; i < other.m_values.size(); ++i)
187            m_values.append(other.m_values[i]->clone());
188    }
189
190    ~KeyframeValueList()
191    {
192    }
193
194    KeyframeValueList& operator=(const KeyframeValueList& other)
195    {
196        KeyframeValueList copy(other);
197        swap(copy);
198        return *this;
199    }
200
201    void swap(KeyframeValueList& other)
202    {
203        std::swap(m_property, other.m_property);
204        m_values.swap(other.m_values);
205    }
206
207    AnimatedPropertyID property() const { return m_property; }
208
209    size_t size() const { return m_values.size(); }
210    const AnimationValue& at(size_t i) const { return *m_values.at(i); }
211
212    // Insert, sorted by keyTime.
213    void insert(PassOwnPtr<const AnimationValue>);
214
215protected:
216    Vector<OwnPtr<const AnimationValue> > m_values;
217    AnimatedPropertyID m_property;
218};
219
220// GraphicsLayer is an abstraction for a rendering surface with backing store,
221// which may have associated transformation and animations.
222
223class GraphicsLayer {
224    WTF_MAKE_NONCOPYABLE(GraphicsLayer); WTF_MAKE_FAST_ALLOCATED;
225public:
226    static PassOwnPtr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayerClient*);
227
228    // FIXME: Replace all uses of this create function with the one that takes a GraphicsLayerFactory.
229    static PassOwnPtr<GraphicsLayer> create(GraphicsLayerClient*);
230
231    virtual ~GraphicsLayer();
232
233    GraphicsLayerClient* client() const { return m_client; }
234
235    // Layer name. Only used to identify layers in debug output
236    const String& name() const { return m_name; }
237    virtual void setName(const String& name) { m_name = name; }
238
239    GraphicsLayer* parent() const { return m_parent; };
240    void setParent(GraphicsLayer*); // Internal use only.
241
242    // Returns true if the layer has the given layer as an ancestor (excluding self).
243    bool hasAncestor(GraphicsLayer*) const;
244
245    const Vector<GraphicsLayer*>& children() const { return m_children; }
246    // Returns true if the child list changed.
247    virtual bool setChildren(const Vector<GraphicsLayer*>&);
248
249    // Add child layers. If the child is already parented, it will be removed from its old parent.
250    virtual void addChild(GraphicsLayer*);
251    virtual void addChildAtIndex(GraphicsLayer*, int index);
252    virtual void addChildAbove(GraphicsLayer* layer, GraphicsLayer* sibling);
253    virtual void addChildBelow(GraphicsLayer* layer, GraphicsLayer* sibling);
254    virtual bool replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild);
255
256    void removeAllChildren();
257    virtual void removeFromParent();
258
259    GraphicsLayer* maskLayer() const { return m_maskLayer; }
260    virtual void setMaskLayer(GraphicsLayer* layer) { m_maskLayer = layer; }
261
262    // The given layer will replicate this layer and its children; the replica renders behind this layer.
263    virtual void setReplicatedByLayer(GraphicsLayer*);
264    // Whether this layer is being replicated by another layer.
265    bool isReplicated() const { return m_replicaLayer; }
266    // The layer that replicates this layer (if any).
267    GraphicsLayer* replicaLayer() const { return m_replicaLayer; }
268
269    const FloatPoint& replicatedLayerPosition() const { return m_replicatedLayerPosition; }
270    void setReplicatedLayerPosition(const FloatPoint& p) { m_replicatedLayerPosition = p; }
271
272    enum ShouldSetNeedsDisplay {
273        DontSetNeedsDisplay,
274        SetNeedsDisplay
275    };
276
277    // Offset is origin of the renderer minus origin of the graphics layer (so either zero or negative).
278    IntSize offsetFromRenderer() const { return m_offsetFromRenderer; }
279    void setOffsetFromRenderer(const IntSize&, ShouldSetNeedsDisplay = SetNeedsDisplay);
280
281    // The position of the layer (the location of its top-left corner in its parent)
282    const FloatPoint& position() const { return m_position; }
283    virtual void setPosition(const FloatPoint& p) { m_position = p; }
284
285    // For platforms that move underlying platform layers on a different thread for scrolling; just update the GraphicsLayer state.
286    virtual void syncPosition(const FloatPoint& p) { m_position = p; }
287
288    // Anchor point: (0, 0) is top left, (1, 1) is bottom right. The anchor point
289    // affects the origin of the transforms.
290    const FloatPoint3D& anchorPoint() const { return m_anchorPoint; }
291    virtual void setAnchorPoint(const FloatPoint3D& p) { m_anchorPoint = p; }
292
293    // The size of the layer.
294    const FloatSize& size() const { return m_size; }
295    virtual void setSize(const FloatSize&);
296
297    // The boundOrigin affects the offset at which content is rendered, and sublayers are positioned.
298    const FloatPoint& boundsOrigin() const { return m_boundsOrigin; }
299    virtual void setBoundsOrigin(const FloatPoint& origin) { m_boundsOrigin = origin; }
300
301    const TransformationMatrix& transform() const { return m_transform; }
302    virtual void setTransform(const TransformationMatrix& t) { m_transform = t; }
303
304    const TransformationMatrix& childrenTransform() const { return m_childrenTransform; }
305    virtual void setChildrenTransform(const TransformationMatrix& t) { m_childrenTransform = t; }
306
307    bool preserves3D() const { return m_preserves3D; }
308    virtual void setPreserves3D(bool b) { m_preserves3D = b; }
309
310    bool masksToBounds() const { return m_masksToBounds; }
311    virtual void setMasksToBounds(bool b) { m_masksToBounds = b; }
312
313    bool drawsContent() const { return m_drawsContent; }
314    virtual void setDrawsContent(bool b) { m_drawsContent = b; }
315
316    bool contentsAreVisible() const { return m_contentsVisible; }
317    virtual void setContentsVisible(bool b) { m_contentsVisible = b; }
318
319    bool acceleratesDrawing() const { return m_acceleratesDrawing; }
320    virtual void setAcceleratesDrawing(bool b) { m_acceleratesDrawing = b; }
321
322    // The color used to paint the layer background. Pass an invalid color to remove it.
323    // Note that this covers the entire layer. Use setContentsToSolidColor() if the color should
324    // only cover the contentsRect.
325    const Color& backgroundColor() const { return m_backgroundColor; }
326    virtual void setBackgroundColor(const Color&);
327
328    // opaque means that we know the layer contents have no alpha
329    bool contentsOpaque() const { return m_contentsOpaque; }
330    virtual void setContentsOpaque(bool b) { m_contentsOpaque = b; }
331
332    bool backfaceVisibility() const { return m_backfaceVisibility; }
333    virtual void setBackfaceVisibility(bool b) { m_backfaceVisibility = b; }
334
335    float opacity() const { return m_opacity; }
336    virtual void setOpacity(float opacity) { m_opacity = opacity; }
337
338#if ENABLE(CSS_FILTERS)
339    const FilterOperations& filters() const { return m_filters; }
340
341    // Returns true if filter can be rendered by the compositor
342    virtual bool setFilters(const FilterOperations& filters) { m_filters = filters; return true; }
343#endif
344
345    // Some GraphicsLayers paint only the foreground or the background content
346    GraphicsLayerPaintingPhase paintingPhase() const { return m_paintingPhase; }
347    void setPaintingPhase(GraphicsLayerPaintingPhase phase) { m_paintingPhase = phase; }
348
349    virtual void setNeedsDisplay() = 0;
350    // mark the given rect (in layer coords) as needing dispay. Never goes deep.
351    virtual void setNeedsDisplayInRect(const FloatRect&) = 0;
352
353    virtual void setContentsNeedsDisplay() { };
354
355    // The tile phase is relative to the GraphicsLayer bounds.
356    virtual void setContentsTilePhase(const IntPoint& p) { m_contentsTilePhase = p; }
357    IntPoint contentsTilePhase() const { return m_contentsTilePhase; }
358
359    virtual void setContentsTileSize(const IntSize& s) { m_contentsTileSize = s; }
360    IntSize contentsTileSize() const { return m_contentsTileSize; }
361    bool hasContentsTiling() const { return !m_contentsTileSize.isEmpty(); }
362
363    // Set that the position/size of the contents (image or video).
364    IntRect contentsRect() const { return m_contentsRect; }
365    virtual void setContentsRect(const IntRect& r) { m_contentsRect = r; }
366
367    // Transitions are identified by a special animation name that cannot clash with a keyframe identifier.
368    static String animationNameForTransition(AnimatedPropertyID);
369
370    // Return true if the animation is handled by the compositing system. If this returns
371    // false, the animation will be run by AnimationController.
372    // These methods handle both transitions and keyframe animations.
373    virtual bool addAnimation(const KeyframeValueList&, const IntSize& /*boxSize*/, const Animation*, const String& /*animationName*/, double /*timeOffset*/)  { return false; }
374    virtual void pauseAnimation(const String& /*animationName*/, double /*timeOffset*/) { }
375    virtual void removeAnimation(const String& /*animationName*/) { }
376
377    virtual void suspendAnimations(double time);
378    virtual void resumeAnimations();
379
380    // Layer contents
381    virtual void setContentsToImage(Image*) { }
382    virtual bool shouldDirectlyCompositeImage(Image*) const { return true; }
383    virtual void setContentsToMedia(PlatformLayer*) { } // video or plug-in
384    // Pass an invalid color to remove the contents layer.
385    virtual void setContentsToSolidColor(const Color&) { }
386    virtual void setContentsToCanvas(PlatformLayer*) { }
387    // FIXME: webkit.org/b/109658
388    // Should unify setContentsToMedia and setContentsToCanvas
389    virtual void setContentsToPlatformLayer(PlatformLayer* layer) { setContentsToMedia(layer); }
390    virtual bool hasContentsLayer() const { return false; }
391
392    // Callback from the underlying graphics system to draw layer contents.
393    void paintGraphicsLayerContents(GraphicsContext&, const IntRect& clip);
394    // Callback from the underlying graphics system when the layer has been displayed
395    virtual void layerDidDisplay(PlatformLayer*) { }
396
397    // For hosting this GraphicsLayer in a native layer hierarchy.
398    virtual PlatformLayer* platformLayer() const { return 0; }
399
400    enum CompositingCoordinatesOrientation { CompositingCoordinatesTopDown, CompositingCoordinatesBottomUp };
401
402    // Flippedness of the contents of this layer. Does not affect sublayer geometry.
403    virtual void setContentsOrientation(CompositingCoordinatesOrientation orientation) { m_contentsOrientation = orientation; }
404    CompositingCoordinatesOrientation contentsOrientation() const { return m_contentsOrientation; }
405
406    void dumpLayer(TextStream&, int indent = 0, LayerTreeAsTextBehavior = LayerTreeAsTextBehaviorNormal) const;
407
408    virtual void setShowDebugBorder(bool show) { m_showDebugBorder = show; }
409    bool isShowingDebugBorder() const { return m_showDebugBorder; }
410
411    virtual void setShowRepaintCounter(bool show) { m_showRepaintCounter = show; }
412    bool isShowingRepaintCounter() const { return m_showRepaintCounter; }
413
414    // FIXME: this is really a paint count.
415    int repaintCount() const { return m_repaintCount; }
416    int incrementRepaintCount() { return ++m_repaintCount; }
417
418    virtual void setDebugBackgroundColor(const Color&) { }
419    virtual void setDebugBorder(const Color&, float /*borderWidth*/) { }
420
421    // z-position is the z-equivalent of position(). It's only used for debugging purposes.
422    virtual float zPosition() const { return m_zPosition; }
423    virtual void setZPosition(float);
424
425    virtual void distributeOpacity(float);
426    virtual float accumulatedOpacity() const;
427
428    virtual void setMaintainsPixelAlignment(bool maintainsAlignment) { m_maintainsPixelAlignment = maintainsAlignment; }
429    virtual bool maintainsPixelAlignment() const { return m_maintainsPixelAlignment; }
430
431    virtual void setAppliesPageScale(bool appliesScale = true) { m_appliesPageScale = appliesScale; }
432    virtual bool appliesPageScale() const { return m_appliesPageScale; }
433
434    float pageScaleFactor() const { return m_client ? m_client->pageScaleFactor() : 1; }
435    float deviceScaleFactor() const { return m_client ? m_client->deviceScaleFactor() : 1; }
436
437    virtual void deviceOrPageScaleFactorChanged() { }
438    void noteDeviceOrPageScaleFactorChangedIncludingDescendants();
439
440    // Some compositing systems may do internal batching to synchronize compositing updates
441    // with updates drawn into the window. These methods flush internal batched state on this layer
442    // and descendant layers, and this layer only.
443    virtual void flushCompositingState(const FloatRect& /* clipRect */) { }
444    virtual void flushCompositingStateForThisLayerOnly() { }
445
446    // If the exposed rect of this layer changes, returns true if this or descendant layers need a flush,
447    // for example to allocate new tiles.
448    virtual bool visibleRectChangeRequiresFlush(const FloatRect& /* clipRect */) const { return false; }
449
450    // Return a string with a human readable form of the layer tree, If debug is true
451    // pointers for the layers and timing data will be included in the returned string.
452    String layerTreeAsText(LayerTreeAsTextBehavior = LayerTreeAsTextBehaviorNormal) const;
453
454    // Return an estimate of the backing store memory cost (in bytes). May be incorrect for tiled layers.
455    virtual double backingStoreMemoryEstimate() const;
456
457    bool usingTiledBacking() const { return m_usingTiledBacking; }
458    virtual TiledBacking* tiledBacking() const { return 0; }
459
460    void resetTrackedRepaints();
461    void addRepaintRect(const FloatRect&);
462
463    static bool supportsBackgroundColorContent()
464    {
465#if USE(CA) || USE(TEXTURE_MAPPER)
466        return true;
467#else
468        return false;
469#endif
470    }
471
472#if USE(COORDINATED_GRAPHICS)
473    static bool supportsContentsTiling();
474#else
475    static bool supportsContentsTiling()
476    {
477        // FIXME: Enable the feature on different ports.
478        return false;
479    }
480#endif
481
482    void updateDebugIndicators();
483
484    virtual bool canThrottleLayerFlush() const { return false; }
485
486protected:
487    // Should be called from derived class destructors. Should call willBeDestroyed() on super.
488    virtual void willBeDestroyed();
489
490#if ENABLE(CSS_FILTERS)
491    // This method is used by platform GraphicsLayer classes to clear the filters
492    // when compositing is not done in hardware. It is not virtual, so the caller
493    // needs to notifiy the change to the platform layer as needed.
494    void clearFilters() { m_filters.clear(); }
495
496    // Given a KeyframeValueList containing filterOperations, return true if the operations are valid.
497    static int validateFilterOperations(const KeyframeValueList&);
498#endif
499
500    // Given a list of TransformAnimationValues, see if all the operations for each keyframe match. If so
501    // return the index of the KeyframeValueList entry that has that list of operations (it may not be
502    // the first entry because some keyframes might have an empty transform and those match any list).
503    // If the lists don't match return -1. On return, if hasBigRotation is true, functions contain
504    // rotations of >= 180 degrees
505    static int validateTransformOperations(const KeyframeValueList&, bool& hasBigRotation);
506
507    virtual bool shouldRepaintOnSizeChange() const { return drawsContent(); }
508
509    virtual void setOpacityInternal(float) { }
510
511    // The layer being replicated.
512    GraphicsLayer* replicatedLayer() const { return m_replicatedLayer; }
513    virtual void setReplicatedLayer(GraphicsLayer* layer) { m_replicatedLayer = layer; }
514
515    GraphicsLayer(GraphicsLayerClient*);
516
517    static void writeIndent(TextStream&, int indent);
518
519    void dumpProperties(TextStream&, int indent, LayerTreeAsTextBehavior) const;
520    virtual void dumpAdditionalProperties(TextStream&, int /*indent*/, LayerTreeAsTextBehavior) const { }
521
522    virtual void getDebugBorderInfo(Color&, float& width) const;
523
524    GraphicsLayerClient* m_client;
525    String m_name;
526
527    // Offset from the owning renderer
528    IntSize m_offsetFromRenderer;
529
530    // Position is relative to the parent GraphicsLayer
531    FloatPoint m_position;
532    FloatPoint3D m_anchorPoint;
533    FloatSize m_size;
534    FloatPoint m_boundsOrigin;
535
536    TransformationMatrix m_transform;
537    TransformationMatrix m_childrenTransform;
538
539    Color m_backgroundColor;
540    float m_opacity;
541    float m_zPosition;
542
543#if ENABLE(CSS_FILTERS)
544    FilterOperations m_filters;
545#endif
546
547    bool m_contentsOpaque : 1;
548    bool m_preserves3D: 1;
549    bool m_backfaceVisibility : 1;
550    bool m_usingTiledBacking : 1;
551    bool m_masksToBounds : 1;
552    bool m_drawsContent : 1;
553    bool m_contentsVisible : 1;
554    bool m_acceleratesDrawing : 1;
555    bool m_maintainsPixelAlignment : 1;
556    bool m_appliesPageScale : 1; // Set for the layer which has the page scale applied to it.
557    bool m_showDebugBorder : 1;
558    bool m_showRepaintCounter : 1;
559
560    GraphicsLayerPaintingPhase m_paintingPhase;
561    CompositingCoordinatesOrientation m_contentsOrientation; // affects orientation of layer contents
562
563    Vector<GraphicsLayer*> m_children;
564    GraphicsLayer* m_parent;
565
566    GraphicsLayer* m_maskLayer; // Reference to mask layer. We don't own this.
567
568    GraphicsLayer* m_replicaLayer; // A layer that replicates this layer. We only allow one, for now.
569                                   // The replica is not parented; this is the primary reference to it.
570    GraphicsLayer* m_replicatedLayer; // For a replica layer, a reference to the original layer.
571    FloatPoint m_replicatedLayerPosition; // For a replica layer, the position of the replica.
572
573    IntRect m_contentsRect;
574    IntPoint m_contentsTilePhase;
575    IntSize m_contentsTileSize;
576
577    int m_repaintCount;
578};
579
580
581} // namespace WebCore
582
583#ifndef NDEBUG
584// Outside the WebCore namespace for ease of invocation from gdb.
585void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer);
586#endif
587
588#endif // USE(ACCELERATED_COMPOSITING)
589
590#endif // GraphicsLayer_h
591