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