2 * Copyright (C) 2009, 2013 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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.
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 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.
28 #include "ChromeClient.h"
29 #include "GraphicsLayerClient.h"
30 #include "GraphicsLayerUpdater.h"
31 #include "RenderLayer.h"
32 #include <wtf/HashMap.h>
33 #include <wtf/OptionSet.h>
37 class FixedPositionViewportConstraints;
39 class GraphicsLayerUpdater;
40 class RenderEmbeddedObject;
43 class ScrollingCoordinator;
44 class StickyPositionViewportConstraints;
47 typedef unsigned LayerTreeFlags;
49 enum class CompositingUpdateType {
57 enum class CompositingReason {
63 BackfaceVisibilityHidden = 1 << 5,
64 ClipsCompositingDescendants = 1 << 6,
67 PositionFixed = 1 << 9,
68 PositionSticky = 1 << 10,
69 OverflowScrollingTouch = 1 << 11,
72 NegativeZIndexChildren = 1 << 14,
73 TransformWithCompositedDescendants = 1 << 15,
74 OpacityWithCompositedDescendants = 1 << 16,
75 MaskWithCompositedDescendants = 1 << 17,
76 ReflectionWithCompositedDescendants = 1 << 18,
77 FilterWithCompositedDescendants = 1 << 19,
78 BlendingWithCompositedDescendants = 1 << 20,
79 Perspective = 1 << 21,
83 IsolatesCompositedBlendingDescendants = 1 << 25,
86 // RenderLayerCompositor manages the hierarchy of
87 // composited RenderLayers. It determines which RenderLayers
88 // become compositing, and creates and maintains a hierarchy of
89 // GraphicsLayers based on the RenderLayer painting order.
91 // There is one RenderLayerCompositor per RenderView.
93 class RenderLayerCompositor final : public GraphicsLayerClient, public GraphicsLayerUpdaterClient {
94 WTF_MAKE_FAST_ALLOCATED;
96 explicit RenderLayerCompositor(RenderView&);
97 virtual ~RenderLayerCompositor();
99 // Return true if this RenderView is in "compositing mode" (i.e. has one or more
100 // composited RenderLayers)
101 bool inCompositingMode() const { return m_compositing; }
102 // This will make a compositing layer at the root automatically, and hook up to
103 // the native view/window system.
104 void enableCompositingMode(bool enable = true);
106 bool inForcedCompositingMode() const { return m_forceCompositingMode; }
108 // Returns true if the accelerated compositing is enabled
109 bool hasAcceleratedCompositing() const { return m_hasAcceleratedCompositing; }
111 bool canRender3DTransforms() const;
113 // Called when the layer hierarchy needs to be updated (compositing layers have been
114 // created, destroyed or re-parented).
115 void setCompositingLayersNeedRebuild(bool needRebuild = true);
116 bool compositingLayersNeedRebuild() const { return m_compositingLayersNeedRebuild; }
118 void willRecalcStyle();
120 // Returns true if the composited layers were actually updated.
121 bool didRecalcStyleWithNoPendingLayout();
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);
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;
132 // Called when the GraphicsLayer for the given RenderLayer has flushed changes inside of flushPendingLayerChanges().
133 void didFlushChangesForLayer(RenderLayer&, const GraphicsLayer*);
135 // Called when something outside WebKit affects the visible rect (e.g. delegated scrolling). Might schedule a layer flush.
136 void didChangeVisibleRect();
138 // Rebuild the tree of compositing layers
139 bool 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 // This is used to cancel any pending update timers when the document goes into page cache.
144 void cancelCompositingLayerUpdate();
146 // Update the compositing state of the given layer. Returns true if that state changed.
147 enum CompositingChangeRepaint { CompositingChangeRepaintNow, CompositingChangeWillRepaintLater };
148 bool updateLayerCompositingState(RenderLayer&, CompositingChangeRepaint = CompositingChangeRepaintNow);
150 // Update the geometry for compositing children of compositingAncestor.
151 void updateCompositingDescendantGeometry(RenderLayer& compositingAncestor, RenderLayer&);
153 // Whether layer's backing needs a graphics layer to do clipping by an ancestor (non-stacking-context parent with overflow).
154 bool clippedByAncestor(RenderLayer&) const;
155 // Whether layer's backing needs a graphics layer to clip z-order children of the given layer.
156 bool clipsCompositingDescendants(const RenderLayer&) const;
158 // Whether the given layer needs an extra 'contents' layer.
159 bool needsContentsCompositingLayer(const RenderLayer&) const;
161 bool supportsFixedRootBackgroundCompositing() const;
162 bool needsFixedRootBackgroundLayer(const RenderLayer&) const;
163 GraphicsLayer* fixedRootBackgroundLayer() const;
165 void rootOrBodyStyleChanged(RenderElement&, const RenderStyle* oldStyle);
167 // Called after the view transparency, or the document or base background color change.
168 void rootBackgroundColorOrTransparencyChanged();
170 // Repaint the appropriate layers when the given RenderLayer starts or stops being composited.
171 void repaintOnCompositingChange(RenderLayer&);
173 void repaintInCompositedAncestor(RenderLayer&, const LayoutRect&);
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);
179 void layerStyleChanged(StyleDifference, RenderLayer&, const RenderStyle* oldStyle);
181 static bool canCompositeClipPath(const RenderLayer&);
183 // Get the nearest ancestor layer that has overflow or clip, but is not a stacking context
184 RenderLayer* enclosingNonStackingClippingLayer(const RenderLayer&) const;
186 // Repaint all composited layers.
187 void repaintCompositedLayers();
189 // Returns true if the given layer needs it own backing store.
190 bool requiresOwnBackingStore(const RenderLayer&, const RenderLayer* compositingAncestorLayer, const LayoutRect& layerCompositedBoundsInAncestor, const LayoutRect& ancestorCompositedBounds) const;
192 WEBCORE_EXPORT RenderLayer& rootRenderLayer() const;
193 GraphicsLayer* rootGraphicsLayer() const;
195 GraphicsLayer* scrollLayer() const { return m_scrollLayer.get(); }
196 GraphicsLayer* clipLayer() const { return m_clipLayer.get(); }
197 GraphicsLayer* rootContentLayer() const { return m_rootContentLayer.get(); }
200 #if ENABLE(RUBBER_BANDING)
201 GraphicsLayer* headerLayer() const { return m_layerForHeader.get(); }
202 GraphicsLayer* footerLayer() const { return m_layerForFooter.get(); }
205 enum RootLayerAttachment {
207 RootLayerAttachedViaChromeClient,
208 RootLayerAttachedViaEnclosingFrame
211 RootLayerAttachment rootLayerAttachment() const { return m_rootLayerAttachment; }
212 void updateRootLayerAttachment();
213 void updateRootLayerPosition();
215 void setIsInWindow(bool);
217 void clearBackingForAllLayers();
219 void layerBecameComposited(const RenderLayer&) { ++m_compositedLayerCount; }
220 void layerBecameNonComposited(const RenderLayer&);
223 // Use by RenderVideo to ask if it should try to use accelerated compositing.
224 bool canAccelerateVideoRendering(RenderVideo&) const;
227 // Walk the tree looking for layers with 3d transforms. Useful in case you need
228 // to know if there is non-affine content, e.g. for drawing into an image.
229 bool has3DContent() const;
231 static RenderLayerCompositor* frameContentsCompositor(RenderWidget*);
232 // Return true if the layers changed.
233 static bool parentFrameContentLayers(RenderWidget*);
235 // Update the geometry of the layers used for clipping and scrolling in frames.
236 void frameViewDidChangeLocation(const IntPoint& contentsOffset);
237 void frameViewDidChangeSize();
238 void frameViewDidScroll();
239 void frameViewDidAddOrRemoveScrollbars();
240 void frameViewDidLayout();
241 void rootFixedBackgroundsChanged();
243 void scrollingLayerDidChange(RenderLayer&);
244 void fixedRootBackgroundLayerChanged();
246 String layerTreeAsText(LayerTreeFlags);
248 float deviceScaleFactor() const override;
249 float contentsScaleMultiplierForNewTiles(const GraphicsLayer*) const override;
250 float pageScaleFactor() const override;
251 float zoomedOutPageScaleFactor() const override;
253 void didCommitChangesForLayer(const GraphicsLayer*) const override;
254 void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) override;
256 void layerTiledBackingUsageChanged(const GraphicsLayer*, bool /*usingTiledBacking*/);
258 bool acceleratedDrawingEnabled() const { return m_acceleratedDrawingEnabled; }
259 bool displayListDrawingEnabled() const { return m_displayListDrawingEnabled; }
261 void deviceOrPageScaleFactorChanged();
263 void windowScreenDidChange(PlatformDisplayID);
265 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizontalScrollbar.get(); }
266 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVerticalScrollbar.get(); }
267 GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.get(); }
268 #if ENABLE(RUBBER_BANDING)
269 GraphicsLayer* layerForOverhangAreas() const { return m_layerForOverhangAreas.get(); }
270 GraphicsLayer* layerForContentShadow() const { return m_contentShadowLayer.get(); }
272 GraphicsLayer* updateLayerForTopOverhangArea(bool wantsLayer);
273 GraphicsLayer* updateLayerForBottomOverhangArea(bool wantsLayer);
274 GraphicsLayer* updateLayerForHeader(bool wantsLayer);
275 GraphicsLayer* updateLayerForFooter(bool wantsLayer);
278 ScrollableArea* scrollableAreaForScrollLayerID(ScrollingNodeID) const;
280 enum class ScrollingNodeChangeFlags {
282 LayerGeometry = 1 << 1,
285 void updateScrollCoordinatedStatus(RenderLayer&, OptionSet<ScrollingNodeChangeFlags>);
286 void removeFromScrollCoordinatedLayers(RenderLayer&);
288 void willRemoveScrollingLayerWithBacking(RenderLayer&, RenderLayerBacking&);
289 void didAddScrollingLayer(RenderLayer&);
292 void registerAllViewportConstrainedLayers();
293 void unregisterAllViewportConstrainedLayers();
295 void registerAllScrollingLayers();
296 void unregisterAllScrollingLayers();
299 void resetTrackedRepaintRects();
300 void setTracksRepaints(bool tracksRepaints) { m_isTrackingRepaints = tracksRepaints; }
303 void setShouldReevaluateCompositingAfterLayout() { m_reevaluateCompositingAfterLayout = true; }
305 bool viewHasTransparentBackground(Color* backgroundColor = nullptr) const;
307 bool hasNonMainLayersWithTiledBacking() const { return m_layersWithTiledBackingCount; }
309 OptionSet<CompositingReason> reasonsForCompositing(const RenderLayer&) const;
311 void setLayerFlushThrottlingEnabled(bool);
312 void disableLayerFlushThrottlingTemporarilyForInteraction();
314 void didPaintBacking(RenderLayerBacking*);
316 const Color& rootExtendedBackgroundColor() const { return m_rootExtendedBackgroundColor; }
318 void updateRootContentLayerClipping();
320 #if ENABLE(CSS_SCROLL_SNAP)
321 void updateScrollSnapPropertiesWithFrameView(const FrameView&);
325 void startTrackingLayerFlushes() { m_layerFlushCount = 0; }
326 unsigned layerFlushCount() const { return m_layerFlushCount; }
328 void startTrackingCompositingUpdates() { m_compositingUpdateCount = 0; }
329 unsigned compositingUpdateCount() const { return m_compositingUpdateCount; }
333 struct CompositingState;
334 struct OverlapExtent;
336 // Returns true if the policy changed.
337 bool updateCompositingPolicy();
339 // GraphicsLayerClient implementation
340 void notifyFlushRequired(const GraphicsLayer*) override;
341 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect&, GraphicsLayerPaintBehavior) override;
342 void customPositionForVisibleRectComputation(const GraphicsLayer*, FloatPoint&) const override;
343 bool isTrackingRepaints() const override { return m_isTrackingRepaints; }
345 // GraphicsLayerUpdaterClient implementation
346 void flushLayersSoon(GraphicsLayerUpdater&) override;
348 // Copy the accelerated compositing related flags from Settings
349 void cacheAcceleratedCompositingFlags();
350 void cacheAcceleratedCompositingFlagsAfterLayout();
352 // Whether the given RL needs a compositing layer.
353 bool needsToBeComposited(const RenderLayer&, RenderLayer::ViewportConstrainedNotCompositedReason* = nullptr) const;
354 // Whether the layer has an intrinsic need for compositing layer.
355 bool requiresCompositingLayer(const RenderLayer&, RenderLayer::ViewportConstrainedNotCompositedReason* = nullptr) const;
356 // Whether the layer could ever be composited.
357 bool canBeComposited(const RenderLayer&) const;
358 bool needsCompositingUpdateForStyleChangeOnNonCompositedLayer(RenderLayer&, const RenderStyle* oldStyle) const;
360 // Make or destroy the backing for this layer; returns true if backing changed.
361 enum class BackingRequired { No, Yes, Unknown };
362 bool updateBacking(RenderLayer&, CompositingChangeRepaint shouldRepaint, BackingRequired = BackingRequired::Unknown);
364 void clearBackingForLayerIncludingDescendants(RenderLayer&);
366 // Repaint this and its child layers.
367 void recursiveRepaintLayer(RenderLayer&);
369 void computeExtent(const OverlapMap&, const RenderLayer&, OverlapExtent&) const;
370 void addToOverlapMap(OverlapMap&, const RenderLayer&, OverlapExtent&);
371 void addToOverlapMapRecursive(OverlapMap&, const RenderLayer&, const RenderLayer* ancestorLayer = nullptr);
373 void updateCompositingLayersTimerFired();
375 // Returns true if any layer's compositing changed
376 void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer&, OverlapMap&, CompositingState&, bool& layersChanged, bool& descendantHas3DTransform);
378 // Recurses down the tree, parenting descendant compositing layers and collecting an array of child layers for the current compositing layer.
379 void rebuildCompositingLayerTree(RenderLayer&, Vector<GraphicsLayer*>& childGraphicsLayersOfEnclosingLayer, int depth);
381 // Recurses down the tree, updating layer geometry only.
382 void updateLayerTreeGeometry(RenderLayer&, int depth);
384 // Hook compositing layers together
385 void setCompositingParent(RenderLayer& childLayer, RenderLayer* parentLayer);
386 void removeCompositedChildren(RenderLayer&);
388 bool layerHas3DContent(const RenderLayer&) const;
389 bool isRunningTransformAnimation(RenderLayerModelObject&) const;
391 void appendDocumentOverlayLayers(Vector<GraphicsLayer*>&);
392 bool hasAnyAdditionalCompositedLayers(const RenderLayer& rootLayer) const;
394 void ensureRootLayer();
395 void destroyRootLayer();
397 void attachRootLayer(RootLayerAttachment);
398 void detachRootLayer();
400 void rootLayerAttachmentChanged();
402 void updateOverflowControlsLayers();
404 void updateScrollLayerPosition();
406 FloatPoint positionForClipLayer() const;
408 void notifyIFramesOfCompositingChange();
410 bool isFlushingLayers() const { return m_flushingLayers; }
411 void updateScrollCoordinatedLayersAfterFlushIncludingSubframes();
412 void updateScrollCoordinatedLayersAfterFlush();
414 FloatRect visibleRectForLayerFlushing() const;
418 GraphicsLayerFactory* graphicsLayerFactory() const;
419 ScrollingCoordinator* scrollingCoordinator() const;
421 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
422 RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const override;
425 bool requiresCompositingForAnimation(RenderLayerModelObject&) const;
426 bool requiresCompositingForTransform(RenderLayerModelObject&) const;
427 bool requiresCompositingForBackfaceVisibility(RenderLayerModelObject&) const;
428 bool requiresCompositingForVideo(RenderLayerModelObject&) const;
429 bool requiresCompositingForCanvas(RenderLayerModelObject&) const;
430 bool requiresCompositingForPlugin(RenderLayerModelObject&) const;
431 bool requiresCompositingForFrame(RenderLayerModelObject&) const;
432 bool requiresCompositingForFilters(RenderLayerModelObject&) const;
433 bool requiresCompositingForWillChange(RenderLayerModelObject&) const;
434 bool requiresCompositingForScrollableFrame() const;
435 bool requiresCompositingForPosition(RenderLayerModelObject&, const RenderLayer&, RenderLayer::ViewportConstrainedNotCompositedReason* = nullptr) const;
436 bool requiresCompositingForOverflowScrolling(const RenderLayer&) const;
437 bool requiresCompositingForIndirectReason(RenderLayerModelObject&, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason&) const;
438 static bool styleChangeMayAffectIndirectCompositingReasons(const RenderLayerModelObject& renderer, const RenderStyle& oldStyle);
441 bool requiresCompositingForScrolling(const RenderLayer&) const;
443 void updateCustomLayersAfterFlush();
446 void updateScrollCoordinationForThisFrame(ScrollingNodeID);
447 ScrollingNodeID attachScrollingNode(RenderLayer&, ScrollingNodeType, ScrollingNodeID parentNodeID);
448 void updateScrollCoordinatedLayer(RenderLayer&, OptionSet<LayerScrollCoordinationRole>, OptionSet<ScrollingNodeChangeFlags>);
449 void detachScrollCoordinatedLayer(RenderLayer&, OptionSet<LayerScrollCoordinationRole>);
450 void reattachSubframeScrollLayers();
452 FixedPositionViewportConstraints computeFixedViewportConstraints(RenderLayer&) const;
453 StickyPositionViewportConstraints computeStickyViewportConstraints(RenderLayer&) const;
455 bool requiresScrollLayer(RootLayerAttachment) const;
456 bool requiresHorizontalScrollbarLayer() const;
457 bool requiresVerticalScrollbarLayer() const;
458 bool requiresScrollCornerLayer() const;
459 #if ENABLE(RUBBER_BANDING)
460 bool requiresOverhangAreasLayer() const;
461 bool requiresContentShadowLayer() const;
464 // True if the FrameView uses a ScrollingCoordinator.
465 bool hasCoordinatedScrolling() const;
466 bool useCoordinatedScrollingForLayer(const RenderLayer&) const;
468 bool isAsyncScrollableStickyLayer(const RenderLayer&, const RenderLayer** enclosingAcceleratedOverflowLayer = nullptr) const;
469 bool isViewportConstrainedFixedOrStickyLayer(const RenderLayer&) const;
471 bool shouldCompositeOverflowControls() const;
473 void scheduleLayerFlushNow();
474 bool isThrottlingLayerFlushes() const;
475 void startInitialLayerFlushTimerIfNeeded();
476 void startLayerFlushTimerIfNeeded();
477 void layerFlushTimerFired();
480 const char* logReasonsForCompositing(const RenderLayer&);
481 void logLayerInfo(const RenderLayer&, int depth);
484 bool documentUsesTiledBacking() const;
485 bool isMainFrameCompositor() const;
487 void setRootLayerConfigurationNeedsUpdate() { m_rootLayerConfigurationNeedsUpdate = true; }
490 RenderView& m_renderView;
491 std::unique_ptr<GraphicsLayer> m_rootContentLayer;
492 Timer m_updateCompositingLayersTimer;
494 ChromeClient::CompositingTriggerFlags m_compositingTriggers { static_cast<ChromeClient::CompositingTriggerFlags>(ChromeClient::AllTriggers) };
495 bool m_hasAcceleratedCompositing { true };
497 CompositingPolicy m_compositingPolicy { CompositingPolicy::Normal };
499 bool m_showDebugBorders { false };
500 bool m_showRepaintCounter { false };
501 bool m_acceleratedDrawingEnabled { false };
502 bool m_displayListDrawingEnabled { false };
504 // When true, we have to wait until layout has happened before we can decide whether to enter compositing mode,
505 // because only then do we know the final size of plugins and iframes.
506 mutable bool m_reevaluateCompositingAfterLayout { false };
508 bool m_compositing { false };
509 bool m_compositingLayersNeedRebuild { false };
510 bool m_rootLayerConfigurationNeedsUpdate { false };
511 bool m_flushingLayers { false };
512 bool m_shouldFlushOnReattach { false };
513 bool m_forceCompositingMode { false };
514 bool m_inPostLayoutUpdate { false }; // true when it's OK to trust layout information (e.g. layer sizes and positions)
515 bool m_subframeScrollLayersNeedReattach { false };
517 bool m_isTrackingRepaints { false }; // Used for testing.
519 int m_compositedLayerCount { 0 };
520 unsigned m_layersWithTiledBackingCount { 0 };
521 unsigned m_layerFlushCount { 0 };
522 unsigned m_compositingUpdateCount { 0 };
524 RootLayerAttachment m_rootLayerAttachment { RootLayerUnattached };
526 // Enclosing clipping layer for iframe content
527 std::unique_ptr<GraphicsLayer> m_clipLayer;
528 std::unique_ptr<GraphicsLayer> m_scrollLayer;
531 HashSet<RenderLayer*> m_scrollingLayers;
532 HashSet<RenderLayer*> m_scrollingLayersNeedingUpdate;
534 HashSet<RenderLayer*> m_scrollCoordinatedLayers;
535 HashSet<RenderLayer*> m_scrollCoordinatedLayersNeedingUpdate;
537 // Enclosing layer for overflow controls and the clipping layer
538 std::unique_ptr<GraphicsLayer> m_overflowControlsHostLayer;
540 // Layers for overflow controls
541 std::unique_ptr<GraphicsLayer> m_layerForHorizontalScrollbar;
542 std::unique_ptr<GraphicsLayer> m_layerForVerticalScrollbar;
543 std::unique_ptr<GraphicsLayer> m_layerForScrollCorner;
544 #if ENABLE(RUBBER_BANDING)
545 std::unique_ptr<GraphicsLayer> m_layerForOverhangAreas;
546 std::unique_ptr<GraphicsLayer> m_contentShadowLayer;
547 std::unique_ptr<GraphicsLayer> m_layerForTopOverhangArea;
548 std::unique_ptr<GraphicsLayer> m_layerForBottomOverhangArea;
549 std::unique_ptr<GraphicsLayer> m_layerForHeader;
550 std::unique_ptr<GraphicsLayer> m_layerForFooter;
553 std::unique_ptr<GraphicsLayerUpdater> m_layerUpdater; // Updates tiled layer visible area periodically while animations are running.
555 Timer m_layerFlushTimer;
557 bool m_layerFlushThrottlingEnabled { false };
558 bool m_layerFlushThrottlingTemporarilyDisabledForInteraction { false };
559 bool m_hasPendingLayerFlush { false };
560 bool m_layerNeedsCompositingUpdate { false };
561 bool m_viewBackgroundIsTransparent { false };
564 int m_rootLayerUpdateCount { 0 };
565 int m_obligateCompositedLayerCount { 0 }; // count of layer that have to be composited.
566 int m_secondaryCompositedLayerCount { 0 }; // count of layers that have to be composited because of stacking or overlap.
567 double m_obligatoryBackingStoreBytes { 0 };
568 double m_secondaryBackingStoreBytes { 0 };
571 Color m_viewBackgroundColor;
572 Color m_rootExtendedBackgroundColor;
574 HashMap<ScrollingNodeID, RenderLayer*> m_scrollingNodeToLayerMap;
577 void paintScrollbar(Scrollbar*, GraphicsContext&, const IntRect& clip);
579 WTF::TextStream& operator<<(WTF::TextStream&, CompositingUpdateType);
580 WTF::TextStream& operator<<(WTF::TextStream&, CompositingPolicy);
582 } // namespace WebCore