Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: Source/core/rendering/CompositedLayerMapping.h

Issue 88863002: Land layer squashing behind a flag (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed feedback Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 ContainerCompositingLayer // layer with no backing store 45 ContainerCompositingLayer // layer with no backing store
46 }; 46 };
47 47
48 48
49 // A GraphicsLayerPaintInfo contains all the info needed to paint a partial subt ree of RenderLayers into a GraphicsLayer. 49 // A GraphicsLayerPaintInfo contains all the info needed to paint a partial subt ree of RenderLayers into a GraphicsLayer.
50 struct GraphicsLayerPaintInfo { 50 struct GraphicsLayerPaintInfo {
51 RenderLayer* renderLayer; 51 RenderLayer* renderLayer;
52 52
53 IntRect compositedBounds; 53 IntRect compositedBounds;
54 54
55 // A temporary offset used for squashing layers, when the origin of the
56 // squashing layer is not yet known.
57 IntSize offsetFromBackingRoot;
58
55 IntSize offsetFromRenderer; 59 IntSize offsetFromRenderer;
56 60
57 GraphicsLayerPaintingPhase paintingPhase; 61 GraphicsLayerPaintingPhase paintingPhase;
58 62
59 bool isBackgroundLayer; 63 bool isBackgroundLayer;
60 }; 64 };
61 65
62 // CompositedLayerMapping keeps track of how RenderLayers of the render tree cor respond to 66 // CompositedLayerMapping keeps track of how RenderLayers of the render tree cor respond to
63 // GraphicsLayers of the composited layer tree. Each instance of CompositedLayer Mapping 67 // GraphicsLayers of the composited layer tree. Each instance of CompositedLayer Mapping
64 // manages a small cluster of GraphicsLayers and the references to which RenderL ayers 68 // manages a small cluster of GraphicsLayers and the references to which RenderL ayers
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 bool hasScrollingLayer() const { return m_scrollingLayer; } 112 bool hasScrollingLayer() const { return m_scrollingLayer; }
109 GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); } 113 GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); }
110 GraphicsLayer* scrollingContentsLayer() const { return m_scrollingContentsLa yer.get(); } 114 GraphicsLayer* scrollingContentsLayer() const { return m_scrollingContentsLa yer.get(); }
111 115
112 bool hasMaskLayer() const { return m_maskLayer; } 116 bool hasMaskLayer() const { return m_maskLayer; }
113 bool hasChildClippingMaskLayer() const { return m_childClippingMaskLayer; } 117 bool hasChildClippingMaskLayer() const { return m_childClippingMaskLayer; }
114 118
115 GraphicsLayer* parentForSublayers() const; 119 GraphicsLayer* parentForSublayers() const;
116 GraphicsLayer* childForSuperlayers() const; 120 GraphicsLayer* childForSuperlayers() const;
117 121
122 GraphicsLayer* squashingLayer() const { return m_squashingLayer.get(); }
123
118 // Returns true for a composited layer that has no backing store of its own, so 124 // Returns true for a composited layer that has no backing store of its own, so
119 // paints into some ancestor layer. 125 // paints into some ancestor layer.
120 bool paintsIntoCompositedAncestor() const { return !(m_requiresOwnBackingSto reForAncestorReasons || m_requiresOwnBackingStoreForIntrinsicReasons); } 126 bool paintsIntoCompositedAncestor() const { return !(m_requiresOwnBackingSto reForAncestorReasons || m_requiresOwnBackingStoreForIntrinsicReasons); }
121 127
122 // Updates whether a backing store is needed based on the layer's compositin g ancestor's 128 // Updates whether a backing store is needed based on the layer's compositin g ancestor's
123 // properties; returns true if the need for a backing store for ancestor rea sons changed. 129 // properties; returns true if the need for a backing store for ancestor rea sons changed.
124 bool updateRequiresOwnBackingStoreForAncestorReasons(const RenderLayer* comp ositingAncestor); 130 bool updateRequiresOwnBackingStoreForAncestorReasons(const RenderLayer* comp ositingAncestor);
125 131
126 // Updates whether a backing store is needed for intrinsic reasons (that is, based on the 132 // Updates whether a backing store is needed for intrinsic reasons (that is, based on the
127 // layer's own properties or compositing reasons); returns true if the intri nsic need for 133 // layer's own properties or compositing reasons); returns true if the intri nsic need for
(...skipping 17 matching lines...) Expand all
145 void animationFinished(const String& name); 151 void animationFinished(const String& name);
146 152
147 IntRect compositedBounds() const; 153 IntRect compositedBounds() const;
148 void setCompositedBounds(const IntRect&); 154 void setCompositedBounds(const IntRect&);
149 void updateCompositedBounds(); 155 void updateCompositedBounds();
150 156
151 void updateAfterWidgetResize(); 157 void updateAfterWidgetResize();
152 void positionOverflowControlsLayers(const IntSize& offsetFromRoot); 158 void positionOverflowControlsLayers(const IntSize& offsetFromRoot);
153 bool hasUnpositionedOverflowControlsLayers() const; 159 bool hasUnpositionedOverflowControlsLayers() const;
154 160
161 void addRenderLayerToSquashingGraphicsLayer(RenderLayer*, IntSize offsetFrom TargetBacking, size_t nextSquashedLayerIndex);
162 void finishAccumulatingSquashingLayers(size_t nextSquashedLayerIndex);
163
155 // GraphicsLayerClient interface 164 // GraphicsLayerClient interface
156 virtual void notifyAnimationStarted(const GraphicsLayer*, double startTime) OVERRIDE; 165 virtual void notifyAnimationStarted(const GraphicsLayer*, double startTime) OVERRIDE;
157 166
158 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL ayerPaintingPhase, const IntRect& clip) OVERRIDE; 167 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL ayerPaintingPhase, const IntRect& clip) OVERRIDE;
159 168
160 virtual void didCommitChangesForLayer(const GraphicsLayer*) const OVERRIDE; 169 virtual void didCommitChangesForLayer(const GraphicsLayer*) const OVERRIDE;
161 virtual bool getCurrentTransform(const GraphicsLayer*, TransformationMatrix& ) const OVERRIDE; 170 virtual bool getCurrentTransform(const GraphicsLayer*, TransformationMatrix& ) const OVERRIDE;
162 171
163 virtual bool isTrackingRepaints() const OVERRIDE; 172 virtual bool isTrackingRepaints() const OVERRIDE;
164 173
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 bool updateForegroundLayer(bool needsForegroundLayer); 212 bool updateForegroundLayer(bool needsForegroundLayer);
204 bool updateBackgroundLayer(bool needsBackgroundLayer); 213 bool updateBackgroundLayer(bool needsBackgroundLayer);
205 bool updateMaskLayer(bool needsMaskLayer); 214 bool updateMaskLayer(bool needsMaskLayer);
206 bool updateClippingMaskLayers(bool needsChildClippingMaskLayer); 215 bool updateClippingMaskLayers(bool needsChildClippingMaskLayer);
207 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer->scroll ableArea() && m_owningLayer->scrollableArea()->horizontalScrollbar(); } 216 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer->scroll ableArea() && m_owningLayer->scrollableArea()->horizontalScrollbar(); }
208 bool requiresVerticalScrollbarLayer() const { return m_owningLayer->scrollab leArea() && m_owningLayer->scrollableArea()->verticalScrollbar(); } 217 bool requiresVerticalScrollbarLayer() const { return m_owningLayer->scrollab leArea() && m_owningLayer->scrollableArea()->verticalScrollbar(); }
209 bool requiresScrollCornerLayer() const { return m_owningLayer->scrollableAre a() && !m_owningLayer->scrollableArea()->scrollCornerAndResizerRect().isEmpty(); } 218 bool requiresScrollCornerLayer() const { return m_owningLayer->scrollableAre a() && !m_owningLayer->scrollableArea()->scrollCornerAndResizerRect().isEmpty(); }
210 bool updateScrollingLayers(bool scrollingLayers); 219 bool updateScrollingLayers(bool scrollingLayers);
211 void updateScrollParent(RenderLayer*); 220 void updateScrollParent(RenderLayer*);
212 void updateClipParent(RenderLayer*); 221 void updateClipParent(RenderLayer*);
222 bool updateSquashingLayers(bool needsSquashingLayers);
213 void updateDrawsContent(bool isSimpleContainer); 223 void updateDrawsContent(bool isSimpleContainer);
214 void registerScrollingLayers(); 224 void registerScrollingLayers();
215 225
216 void setBackgroundLayerPaintsFixedRootBackground(bool); 226 void setBackgroundLayerPaintsFixedRootBackground(bool);
217 227
218 GraphicsLayerPaintingPhase paintingPhaseForPrimaryLayer() const; 228 GraphicsLayerPaintingPhase paintingPhaseForPrimaryLayer() const;
219 229
220 IntSize contentOffsetInCompostingLayer() const; 230 IntSize contentOffsetInCompostingLayer() const;
221 // Result is transform origin in pixels. 231 // Result is transform origin in pixels.
222 FloatPoint3D computeTransformOrigin(const IntRect& borderBox) const; 232 FloatPoint3D computeTransformOrigin(const IntRect& borderBox) const;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // the background layer (or repainting). 332 // the background layer (or repainting).
323 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need to draw the foreground separately. 333 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need to draw the foreground separately.
324 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need to draw the background separately. 334 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need to draw the background separately.
325 335
326 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; 336 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar;
327 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; 337 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar;
328 OwnPtr<GraphicsLayer> m_layerForScrollCorner; 338 OwnPtr<GraphicsLayer> m_layerForScrollCorner;
329 339
330 OwnPtr<WebAnimationProvider> m_animationProvider; 340 OwnPtr<WebAnimationProvider> m_animationProvider;
331 341
342 OwnPtr<GraphicsLayer> m_squashingContainmentLayer; // Only used if any squas hed layers exist, to contain the squashed layers as siblings to the rest of the GraphicsLayer tree chunk.
343 OwnPtr<GraphicsLayer> m_squashingLayer; // Only used if any squashed layers exist, this is the backing that squashed layers paint into.
344 Vector<GraphicsLayerPaintInfo> m_squashedLayers;
345
332 IntRect m_compositedBounds; 346 IntRect m_compositedBounds;
333 347
334 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make transform-origin work 348 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make transform-origin work
335 bool m_boundsConstrainedByClipping; 349 bool m_boundsConstrainedByClipping;
336 bool m_isMainFrameRenderViewLayer; 350 bool m_isMainFrameRenderViewLayer;
337 bool m_requiresOwnBackingStoreForIntrinsicReasons; 351 bool m_requiresOwnBackingStoreForIntrinsicReasons;
338 bool m_requiresOwnBackingStoreForAncestorReasons; 352 bool m_requiresOwnBackingStoreForAncestorReasons;
339 bool m_canCompositeFilters; 353 bool m_canCompositeFilters;
340 bool m_backgroundLayerPaintsFixedRootBackground; 354 bool m_backgroundLayerPaintsFixedRootBackground;
341 }; 355 };
342 356
343 } // namespace WebCore 357 } // namespace WebCore
344 358
345 #endif // CompositedLayerMapping_h 359 #endif // CompositedLayerMapping_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698