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