CTTE Timer and DeferrableOneShotTimer
[WebKit-https.git] / Source / WebCore / rendering / RenderLayerCompositor.h
1 /*
2  * Copyright (C) 2009, 2013 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 RenderLayerCompositor_h
27 #define RenderLayerCompositor_h
28
29 #if USE(ACCELERATED_COMPOSITING)
30
31 #include "ChromeClient.h"
32 #include "GraphicsLayerClient.h"
33 #include "GraphicsLayerUpdater.h"
34 #include "RenderLayer.h"
35 #include <wtf/HashMap.h>
36
37 namespace WebCore {
38
39 class FixedPositionViewportConstraints;
40 class GraphicsLayer;
41 class GraphicsLayerUpdater;
42 class RenderEmbeddedObject;
43 class RenderNamedFlowFragment;
44 class RenderVideo;
45 class RenderWidget;
46 class ScrollingCoordinator;
47 class StickyPositionViewportConstraints;
48 class TiledBacking;
49
50 typedef unsigned LayerTreeFlags;
51
52 enum CompositingUpdateType {
53     CompositingUpdateAfterStyleChange,
54     CompositingUpdateAfterLayout,
55     CompositingUpdateOnHitTest,
56     CompositingUpdateOnScroll,
57     CompositingUpdateOnCompositedScroll
58 };
59
60 enum {
61     CompositingReasonNone                                   = 0,
62     CompositingReason3DTransform                            = 1 << 0,
63     CompositingReasonVideo                                  = 1 << 1,
64     CompositingReasonCanvas                                 = 1 << 2,
65     CompositingReasonPlugin                                 = 1 << 3,
66     CompositingReasonIFrame                                 = 1 << 4,
67     CompositingReasonBackfaceVisibilityHidden               = 1 << 5,
68     CompositingReasonClipsCompositingDescendants            = 1 << 6,
69     CompositingReasonAnimation                              = 1 << 7,
70     CompositingReasonFilters                                = 1 << 8,
71     CompositingReasonPositionFixed                          = 1 << 9,
72     CompositingReasonPositionSticky                         = 1 << 10,
73     CompositingReasonOverflowScrollingTouch                 = 1 << 11,
74     CompositingReasonStacking                               = 1 << 12,
75     CompositingReasonOverlap                                = 1 << 13,
76     CompositingReasonNegativeZIndexChildren                 = 1 << 14,
77     CompositingReasonTransformWithCompositedDescendants     = 1 << 15,
78     CompositingReasonOpacityWithCompositedDescendants       = 1 << 16,
79     CompositingReasonMaskWithCompositedDescendants          = 1 << 17,
80     CompositingReasonReflectionWithCompositedDescendants    = 1 << 18,
81     CompositingReasonFilterWithCompositedDescendants        = 1 << 19,
82     CompositingReasonBlendingWithCompositedDescendants      = 1 << 20,
83     CompositingReasonPerspective                            = 1 << 21,
84     CompositingReasonPreserve3D                             = 1 << 22,
85     CompositingReasonRoot                                   = 1 << 23,
86     CompositingReasonBlending                               = 1 << 24
87 };
88 typedef unsigned CompositingReasons;
89
90 // RenderLayerCompositor manages the hierarchy of
91 // composited RenderLayers. It determines which RenderLayers
92 // become compositing, and creates and maintains a hierarchy of
93 // GraphicsLayers based on the RenderLayer painting order.
94 // 
95 // There is one RenderLayerCompositor per RenderView.
96
97 class RenderLayerCompositor : public GraphicsLayerClient, public GraphicsLayerUpdaterClient {
98     WTF_MAKE_FAST_ALLOCATED;
99 public:
100     explicit RenderLayerCompositor(RenderView&);
101     ~RenderLayerCompositor();
102
103     // Return true if this RenderView is in "compositing mode" (i.e. has one or more
104     // composited RenderLayers)
105     bool inCompositingMode() const { return m_compositing; }
106     // This will make a compositing layer at the root automatically, and hook up to
107     // the native view/window system.
108     void enableCompositingMode(bool enable = true);
109
110     bool inForcedCompositingMode() const { return m_forceCompositingMode; }
111
112     // Returns true if the accelerated compositing is enabled
113     bool hasAcceleratedCompositing() const { return m_hasAcceleratedCompositing; }
114
115     bool canRender3DTransforms() const;
116
117     // Copy the accelerated compositing related flags from Settings
118     void cacheAcceleratedCompositingFlags();
119
120     // Called when the layer hierarchy needs to be updated (compositing layers have been
121     // created, destroyed or re-parented).
122     void setCompositingLayersNeedRebuild(bool needRebuild = true);
123     bool compositingLayersNeedRebuild() const { return m_compositingLayersNeedRebuild; }
124
125     // GraphicsLayers buffer state, which gets pushed to the underlying platform layers
126     // at specific times.
127     void scheduleLayerFlush(bool canThrottle);
128     void flushPendingLayerChanges(bool isFlushRoot = true);
129     
130     // flushPendingLayerChanges() flushes the entire GraphicsLayer tree, which can cross frame boundaries.
131     // This call returns the rootmost compositor that is being flushed (including self).
132     RenderLayerCompositor* enclosingCompositorFlushingLayers() const;
133
134     // Called when the GraphicsLayer for the given RenderLayer has flushed changes inside of flushPendingLayerChanges().
135     void didFlushChangesForLayer(RenderLayer&, const GraphicsLayer*);
136
137     // Called when something outside WebKit affects the visible rect (e.g. delegated scrolling). Might schedule a layer flush.
138     void didChangeVisibleRect();
139     
140     // Rebuild the tree of compositing layers
141     void updateCompositingLayers(CompositingUpdateType, RenderLayer* updateRoot = nullptr);
142     // This is only used when state changes and we do not exepect a style update or layout to happen soon (e.g. when
143     // we discover that an iframe is overlapped during painting).
144     void scheduleCompositingLayerUpdate();
145
146     // Update the maps that we use to distribute layers to coresponding regions.
147     void updateRenderFlowThreadLayersIfNeeded();
148     
149     // Update the compositing state of the given layer. Returns true if that state changed.
150     enum CompositingChangeRepaint { CompositingChangeRepaintNow, CompositingChangeWillRepaintLater };
151     bool updateLayerCompositingState(RenderLayer&, CompositingChangeRepaint = CompositingChangeRepaintNow);
152
153     // Update the geometry for compositing children of compositingAncestor.
154     void updateCompositingDescendantGeometry(RenderLayer& compositingAncestor, RenderLayer&, bool compositedChildrenOnly);
155     
156     // Whether layer's backing needs a graphics layer to do clipping by an ancestor (non-stacking-context parent with overflow).
157     bool clippedByAncestor(RenderLayer&) const;
158     // Whether layer's backing needs a graphics layer to clip z-order children of the given layer.
159     bool clipsCompositingDescendants(const RenderLayer&) const;
160
161     // Whether the given layer needs an extra 'contents' layer.
162     bool needsContentsCompositingLayer(const RenderLayer&) const;
163
164     bool supportsFixedRootBackgroundCompositing() const;
165     bool needsFixedRootBackgroundLayer(const RenderLayer&) const;
166     GraphicsLayer* fixedRootBackgroundLayer() const;
167     
168     // Return the bounding box required for compositing layer and its childern, relative to ancestorLayer.
169     // If layerBoundingBox is not 0, on return it contains the bounding box of this layer only.
170     LayoutRect calculateCompositedBounds(const RenderLayer&, const RenderLayer& ancestorLayer) const;
171
172     // Repaint the appropriate layers when the given RenderLayer starts or stops being composited.
173     void repaintOnCompositingChange(RenderLayer&);
174     
175     void repaintInCompositedAncestor(RenderLayer&, const LayoutRect&);
176     
177     // Notify us that a layer has been added or removed
178     void layerWasAdded(RenderLayer& parent, RenderLayer& child);
179     void layerWillBeRemoved(RenderLayer& parent, RenderLayer& child);
180
181     // Get the nearest ancestor layer that has overflow or clip, but is not a stacking context
182     RenderLayer* enclosingNonStackingClippingLayer(const RenderLayer&) const;
183
184     // Repaint parts of all composited layers that intersect the given absolute rectangle (or the entire layer if the pointer is null).
185     void repaintCompositedLayers(const IntRect* = 0);
186
187     // Returns true if the given layer needs it own backing store.
188     bool requiresOwnBackingStore(const RenderLayer&, const RenderLayer* compositingAncestorLayer, const IntRect& layerCompositedBoundsInAncestor, const IntRect& ancestorCompositedBounds) const;
189
190     RenderLayer& rootRenderLayer() const;
191     GraphicsLayer* rootGraphicsLayer() const;
192     GraphicsLayer* scrollLayer() const;
193
194 #if ENABLE(RUBBER_BANDING)
195     GraphicsLayer* headerLayer() const;
196     GraphicsLayer* footerLayer() const;
197 #endif
198
199     enum RootLayerAttachment {
200         RootLayerUnattached,
201         RootLayerAttachedViaChromeClient,
202         RootLayerAttachedViaEnclosingFrame
203     };
204
205     RootLayerAttachment rootLayerAttachment() const { return m_rootLayerAttachment; }
206     void updateRootLayerAttachment();
207     void updateRootLayerPosition();
208     
209     void setIsInWindow(bool);
210
211     void clearBackingForAllLayers();
212     
213     void layerBecameComposited(const RenderLayer&) { ++m_compositedLayerCount; }
214     void layerBecameNonComposited(const RenderLayer&);
215     
216 #if ENABLE(VIDEO)
217     // Use by RenderVideo to ask if it should try to use accelerated compositing.
218     bool canAccelerateVideoRendering(RenderVideo&) const;
219 #endif
220
221     // Walk the tree looking for layers with 3d transforms. Useful in case you need
222     // to know if there is non-affine content, e.g. for drawing into an image.
223     bool has3DContent() const;
224     
225     // Most platforms connect compositing layer trees between iframes and their parent document.
226     // Some (currently just Mac) allow iframes to do their own compositing.
227     static bool allowsIndependentlyCompositedFrames(const FrameView*);
228     bool shouldPropagateCompositingToEnclosingFrame() const;
229
230     static RenderLayerCompositor* frameContentsCompositor(RenderWidget*);
231     // Return true if the layers changed.
232     static bool parentFrameContentLayers(RenderWidget*);
233
234     // Update the geometry of the layers used for clipping and scrolling in frames.
235     void frameViewDidChangeLocation(const IntPoint& contentsOffset);
236     void frameViewDidChangeSize();
237     void frameViewDidScroll();
238     void frameViewDidAddOrRemoveScrollbars();
239     void frameViewDidLayout();
240     void rootFixedBackgroundsChanged();
241
242     void scrollingLayerDidChange(RenderLayer&);
243     void fixedRootBackgroundLayerChanged();
244
245     String layerTreeAsText(LayerTreeFlags);
246
247     virtual float deviceScaleFactor() const OVERRIDE;
248     virtual float contentsScaleMultiplierForNewTiles(const GraphicsLayer*) const OVERRIDE;
249     virtual float pageScaleFactor() const OVERRIDE;
250     virtual void didCommitChangesForLayer(const GraphicsLayer*) const OVERRIDE;
251     virtual void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) OVERRIDE;
252
253     void layerTiledBackingUsageChanged(const GraphicsLayer*, bool /*usingTiledBacking*/);
254     
255     bool keepLayersPixelAligned() const;
256     bool acceleratedDrawingEnabled() const { return m_acceleratedDrawingEnabled; }
257
258     void deviceOrPageScaleFactorChanged();
259
260     void windowScreenDidChange(PlatformDisplayID);
261
262     GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizontalScrollbar.get(); }
263     GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVerticalScrollbar.get(); }
264     GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.get(); }
265 #if ENABLE(RUBBER_BANDING)
266     GraphicsLayer* layerForOverhangAreas() const { return m_layerForOverhangAreas.get(); }
267     GraphicsLayer* layerForContentShadow() const { return m_contentShadowLayer.get(); }
268
269     GraphicsLayer* updateLayerForTopOverhangArea(bool wantsLayer);
270     GraphicsLayer* updateLayerForBottomOverhangArea(bool wantsLayer);
271     GraphicsLayer* updateLayerForHeader(bool wantsLayer);
272     GraphicsLayer* updateLayerForFooter(bool wantsLayer);
273 #endif
274
275     void updateViewportConstraintStatus(RenderLayer&);
276     void removeViewportConstrainedLayer(RenderLayer&);
277
278 #if PLATFORM(IOS)
279     void registerAllViewportConstrainedLayers();
280     void unregisterAllViewportConstrainedLayers();
281
282     void scrollingLayerAddedOrUpdated(RenderLayer*);
283     void scrollingLayerRemoved(RenderLayer*, PlatformLayer* scrollingLayer, PlatformLayer* contentsLayer);
284
285     void registerAllScrollingLayers();
286     void unregisterAllScrollingLayers();
287 #endif
288     void resetTrackedRepaintRects();
289     void setTracksRepaints(bool);
290
291     void setShouldReevaluateCompositingAfterLayout() { m_reevaluateCompositingAfterLayout = true; }
292
293     bool viewHasTransparentBackground(Color* backgroundColor = 0) const;
294
295     bool hasNonMainLayersWithTiledBacking() const { return m_layersWithTiledBackingCount; }
296
297     CompositingReasons reasonsForCompositing(const RenderLayer&) const;
298
299     void setLayerFlushThrottlingEnabled(bool);
300     void disableLayerFlushThrottlingTemporarilyForInteraction();
301     
302     void didPaintBacking(RenderLayerBacking*);
303
304     bool mainFrameBackingIsTiledWithMargin() const;
305
306 private:
307     class OverlapMap;
308
309     // GraphicsLayerClient implementation
310     virtual void notifyAnimationStarted(const GraphicsLayer*, double) OVERRIDE { }
311     virtual void notifyFlushRequired(const GraphicsLayer*) OVERRIDE;
312     virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect&) OVERRIDE;
313
314     virtual bool isTrackingRepaints() const OVERRIDE;
315     
316     // GraphicsLayerUpdaterClient implementation
317     virtual void flushLayers(GraphicsLayerUpdater*) OVERRIDE;
318     virtual void customPositionForVisibleRectComputation(const GraphicsLayer*, FloatPoint&) const OVERRIDE;
319     
320     // Whether the given RL needs a compositing layer.
321     bool needsToBeComposited(const RenderLayer&, RenderLayer::ViewportConstrainedNotCompositedReason* = 0) const;
322     // Whether the layer has an intrinsic need for compositing layer.
323     bool requiresCompositingLayer(const RenderLayer&, RenderLayer::ViewportConstrainedNotCompositedReason* = 0) const;
324     // Whether the layer could ever be composited.
325     bool canBeComposited(const RenderLayer&) const;
326
327     // Make or destroy the backing for this layer; returns true if backing changed.
328     bool updateBacking(RenderLayer&, CompositingChangeRepaint shouldRepaint);
329
330     void clearBackingForLayerIncludingDescendants(RenderLayer&);
331
332     // Repaint the given rect (which is layer's coords), and regions of child layers that intersect that rect.
333     void recursiveRepaintLayer(RenderLayer&, const IntRect* = nullptr);
334
335     void addToOverlapMap(OverlapMap&, RenderLayer&, IntRect& layerBounds, bool& boundsComputed);
336     void addToOverlapMapRecursive(OverlapMap&, RenderLayer&, RenderLayer* ancestorLayer = nullptr);
337
338     void updateCompositingLayersTimerFired(Timer<RenderLayerCompositor>&);
339
340     // Returns true if any layer's compositing changed
341     void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer&, OverlapMap*, struct CompositingState&, bool& layersChanged, bool& descendantHas3DTransform);
342
343     void computeRegionCompositingRequirements(RenderNamedFlowFragment*, OverlapMap*, CompositingState&, bool& layersChanged, bool& anyDescendantHas3DTransform);
344     
345     // Recurses down the tree, parenting descendant compositing layers and collecting an array of child layers for the current compositing layer.
346     void rebuildCompositingLayerTree(RenderLayer&, Vector<GraphicsLayer*>& childGraphicsLayersOfEnclosingLayer, int depth);
347
348     // Recurses down the RenderFlowThread tree, parenting descendant compositing layers and collecting an array of child 
349     // layers for the current compositing layer corresponding to the anonymous region (that belongs to the region's parent).
350     void rebuildRegionCompositingLayerTree(RenderNamedFlowFragment*, Vector<GraphicsLayer*>& childList, int depth);
351
352     // Recurses down the tree, updating layer geometry only.
353     void updateLayerTreeGeometry(RenderLayer&, int depth);
354     
355     // Hook compositing layers together
356     void setCompositingParent(RenderLayer& childLayer, RenderLayer* parentLayer);
357     void removeCompositedChildren(RenderLayer&);
358
359     bool layerHas3DContent(const RenderLayer&) const;
360     bool isRunningAcceleratedTransformAnimation(RenderLayerModelObject&) const;
361
362     bool hasAnyAdditionalCompositedLayers(const RenderLayer& rootLayer) const;
363
364     void ensureRootLayer();
365     void destroyRootLayer();
366
367     void attachRootLayer(RootLayerAttachment);
368     void detachRootLayer();
369     
370     void rootLayerAttachmentChanged();
371
372     void updateOverflowControlsLayers();
373
374     void notifyIFramesOfCompositingChange();
375
376     bool isFlushingLayers() const { return m_flushingLayers; }
377     
378     Page* page() const;
379     TiledBacking* pageTiledBacking() const;
380     
381     GraphicsLayerFactory* graphicsLayerFactory() const;
382     ScrollingCoordinator* scrollingCoordinator() const;
383
384     // Whether a running transition or animation enforces the need for a compositing layer.
385     bool requiresCompositingForAnimation(RenderLayerModelObject&) const;
386     bool requiresCompositingForTransform(RenderLayerModelObject&) const;
387     bool requiresCompositingForVideo(RenderLayerModelObject&) const;
388     bool requiresCompositingForCanvas(RenderLayerModelObject&) const;
389     bool requiresCompositingForPlugin(RenderLayerModelObject&) const;
390     bool requiresCompositingForFrame(RenderLayerModelObject&) const;
391     bool requiresCompositingForFilters(RenderLayerModelObject&) const;
392     bool requiresCompositingForBlending(RenderLayerModelObject&) const;
393     bool requiresCompositingForScrollableFrame() const;
394     bool requiresCompositingForPosition(RenderLayerModelObject&, const RenderLayer&, RenderLayer::ViewportConstrainedNotCompositedReason* = 0) const;
395     bool requiresCompositingForOverflowScrolling(const RenderLayer&) const;
396     bool requiresCompositingForIndirectReason(RenderLayerModelObject&, bool hasCompositedDescendants, bool hasBlendedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason&) const;
397
398 #if PLATFORM(IOS)
399     bool requiresCompositingForScrolling(RenderLayerModelObject&) const;
400
401     void updateCustomLayersAfterFlush();
402
403     ChromeClient* chromeClient() const;
404
405     void startInitialLayerFlushTimerIfNeeded();
406 #endif
407
408     void addViewportConstrainedLayer(RenderLayer&);
409     void registerOrUpdateViewportConstrainedLayer(RenderLayer&);
410     void unregisterViewportConstrainedLayer(RenderLayer&);
411
412     FixedPositionViewportConstraints computeFixedViewportConstraints(RenderLayer&) const;
413     StickyPositionViewportConstraints computeStickyViewportConstraints(RenderLayer&) const;
414
415     bool requiresScrollLayer(RootLayerAttachment) const;
416     bool requiresHorizontalScrollbarLayer() const;
417     bool requiresVerticalScrollbarLayer() const;
418     bool requiresScrollCornerLayer() const;
419 #if ENABLE(RUBBER_BANDING)
420     bool requiresOverhangAreasLayer() const;
421     bool requiresContentShadowLayer() const;
422 #endif
423
424     bool hasCoordinatedScrolling() const;
425     bool shouldCompositeOverflowControls() const;
426
427     void scheduleLayerFlushNow();
428     bool isThrottlingLayerFlushes() const;
429     void startLayerFlushTimerIfNeeded();
430     void layerFlushTimerFired(Timer<RenderLayerCompositor>&);
431
432     void paintRelatedMilestonesTimerFired(Timer<RenderLayerCompositor>&);
433
434 #if !LOG_DISABLED
435     const char* logReasonsForCompositing(const RenderLayer&);
436     void logLayerInfo(const RenderLayer&, int depth);
437 #endif
438
439     bool mainFrameBackingIsTiled() const;
440
441 private:
442     RenderView& m_renderView;
443     std::unique_ptr<GraphicsLayer> m_rootContentLayer;
444     Timer<RenderLayerCompositor> m_updateCompositingLayersTimer;
445
446     bool m_hasAcceleratedCompositing;
447     ChromeClient::CompositingTriggerFlags m_compositingTriggers;
448
449     int m_compositedLayerCount;
450     bool m_showDebugBorders;
451     bool m_showRepaintCounter;
452     bool m_acceleratedDrawingEnabled;
453
454     // When true, we have to wait until layout has happened before we can decide whether to enter compositing mode,
455     // because only then do we know the final size of plugins and iframes.
456     mutable bool m_reevaluateCompositingAfterLayout;
457
458     bool m_compositing;
459     bool m_compositingLayersNeedRebuild;
460     bool m_flushingLayers;
461     bool m_shouldFlushOnReattach;
462     bool m_forceCompositingMode;
463     bool m_inPostLayoutUpdate; // true when it's OK to trust layout information (e.g. layer sizes and positions)
464
465     bool m_isTrackingRepaints; // Used for testing.
466
467     unsigned m_layersWithTiledBackingCount;
468
469     RootLayerAttachment m_rootLayerAttachment;
470
471     // Enclosing clipping layer for iframe content
472     std::unique_ptr<GraphicsLayer> m_clipLayer;
473     std::unique_ptr<GraphicsLayer> m_scrollLayer;
474
475 #if PLATFORM(IOS)
476     HashSet<RenderLayer*> m_scrollingLayers;
477     HashSet<RenderLayer*> m_scrollingLayersNeedingUpdate;
478 #endif
479     HashSet<RenderLayer*> m_viewportConstrainedLayers;
480     HashSet<RenderLayer*> m_viewportConstrainedLayersNeedingUpdate;
481
482     // Enclosing layer for overflow controls and the clipping layer
483     std::unique_ptr<GraphicsLayer> m_overflowControlsHostLayer;
484
485     // Layers for overflow controls
486     std::unique_ptr<GraphicsLayer> m_layerForHorizontalScrollbar;
487     std::unique_ptr<GraphicsLayer> m_layerForVerticalScrollbar;
488     std::unique_ptr<GraphicsLayer> m_layerForScrollCorner;
489 #if ENABLE(RUBBER_BANDING)
490     std::unique_ptr<GraphicsLayer> m_layerForOverhangAreas;
491     std::unique_ptr<GraphicsLayer> m_contentShadowLayer;
492     std::unique_ptr<GraphicsLayer> m_layerForTopOverhangArea;
493     std::unique_ptr<GraphicsLayer> m_layerForBottomOverhangArea;
494     std::unique_ptr<GraphicsLayer> m_layerForHeader;
495     std::unique_ptr<GraphicsLayer> m_layerForFooter;
496 #endif
497
498     OwnPtr<GraphicsLayerUpdater> m_layerUpdater; // Updates tiled layer visible area periodically while animations are running.
499
500     Timer<RenderLayerCompositor> m_layerFlushTimer;
501     bool m_layerFlushThrottlingEnabled;
502     bool m_layerFlushThrottlingTemporarilyDisabledForInteraction;
503     bool m_hasPendingLayerFlush;
504
505     Timer<RenderLayerCompositor> m_paintRelatedMilestonesTimer;
506
507 #if !LOG_DISABLED
508     int m_rootLayerUpdateCount;
509     int m_obligateCompositedLayerCount; // count of layer that have to be composited.
510     int m_secondaryCompositedLayerCount; // count of layers that have to be composited because of stacking or overlap.
511     double m_obligatoryBackingStoreBytes;
512     double m_secondaryBackingStoreBytes;
513 #endif
514 };
515
516
517 } // namespace WebCore
518
519 #endif // USE(ACCELERATED_COMPOSITING)
520
521 #endif // RenderLayerCompositor_h