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

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

Issue 189233012: Convert CompositingLayerMapping code to use reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make RenderLayer non-copyable Created 6 years, 9 months 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
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // CompositedLayerMapping keeps track of how RenderLayers of the render tree cor respond to 72 // CompositedLayerMapping keeps track of how RenderLayers of the render tree cor respond to
73 // GraphicsLayers of the composited layer tree. Each instance of CompositedLayer Mapping 73 // GraphicsLayers of the composited layer tree. Each instance of CompositedLayer Mapping
74 // manages a small cluster of GraphicsLayers and the references to which RenderL ayers 74 // manages a small cluster of GraphicsLayers and the references to which RenderL ayers
75 // and paint phases contribute to each GraphicsLayer. 75 // and paint phases contribute to each GraphicsLayer.
76 // 76 //
77 // Currently (Oct. 2013) there is one CompositedLayerMapping for each RenderLaye r, 77 // Currently (Oct. 2013) there is one CompositedLayerMapping for each RenderLaye r,
78 // but this is likely to evolve soon. 78 // but this is likely to evolve soon.
79 class CompositedLayerMapping FINAL : public GraphicsLayerClient { 79 class CompositedLayerMapping FINAL : public GraphicsLayerClient {
80 WTF_MAKE_NONCOPYABLE(CompositedLayerMapping); WTF_MAKE_FAST_ALLOCATED; 80 WTF_MAKE_NONCOPYABLE(CompositedLayerMapping); WTF_MAKE_FAST_ALLOCATED;
81 public: 81 public:
82 explicit CompositedLayerMapping(RenderLayer*); 82 explicit CompositedLayerMapping(RenderLayer&);
83 virtual ~CompositedLayerMapping(); 83 virtual ~CompositedLayerMapping();
84 84
85 RenderLayer* owningLayer() const { return m_owningLayer; } 85 RenderLayer& owningLayer() const { return m_owningLayer; }
86 86
87 enum UpdateAfterLayoutFlag { 87 enum UpdateAfterLayoutFlag {
88 CompositingChildrenOnly = 1 << 0, 88 CompositingChildrenOnly = 1 << 0,
89 NeedsFullRepaint = 1 << 1, 89 NeedsFullRepaint = 1 << 1,
90 IsUpdateRoot = 1 << 2 90 IsUpdateRoot = 1 << 2
91 }; 91 };
92 typedef unsigned UpdateAfterLayoutFlags; 92 typedef unsigned UpdateAfterLayoutFlags;
93 void updateAfterLayout(UpdateAfterLayoutFlags); 93 void updateAfterLayout(UpdateAfterLayoutFlags);
94 94
95 // Returns true if layer configuration changed. 95 // Returns true if layer configuration changed.
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 virtual String debugName(const GraphicsLayer*) OVERRIDE; 201 virtual String debugName(const GraphicsLayer*) OVERRIDE;
202 202
203 LayoutSize subpixelAccumulation() const { return m_subpixelAccumulation; } 203 LayoutSize subpixelAccumulation() const { return m_subpixelAccumulation; }
204 private: 204 private:
205 void createPrimaryGraphicsLayer(); 205 void createPrimaryGraphicsLayer();
206 void destroyGraphicsLayers(); 206 void destroyGraphicsLayers();
207 207
208 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); 208 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons);
209 bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, C ompositingReasons); 209 bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, C ompositingReasons);
210 210
211 RenderLayerModelObject* renderer() const { return m_owningLayer->renderer(); } 211 RenderLayerModelObject* renderer() const { return m_owningLayer.renderer(); }
212 RenderLayerCompositor* compositor() const { return m_owningLayer->compositor (); } 212 RenderLayerCompositor* compositor() const { return m_owningLayer.compositor( ); }
213 213
214 void updateInternalHierarchy(); 214 void updateInternalHierarchy();
215 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip); 215 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip);
216 bool updateChildTransformLayer(bool needsChildTransformLayer); 216 bool updateChildTransformLayer(bool needsChildTransformLayer);
217 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool n eedsVerticalScrollbarLayer, bool needsScrollCornerLayer); 217 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool n eedsVerticalScrollbarLayer, bool needsScrollCornerLayer);
218 bool updateForegroundLayer(bool needsForegroundLayer); 218 bool updateForegroundLayer(bool needsForegroundLayer);
219 bool updateBackgroundLayer(bool needsBackgroundLayer); 219 bool updateBackgroundLayer(bool needsBackgroundLayer);
220 bool updateMaskLayer(bool needsMaskLayer); 220 bool updateMaskLayer(bool needsMaskLayer);
221 bool updateClippingMaskLayers(bool needsChildClippingMaskLayer); 221 bool updateClippingMaskLayers(bool needsChildClippingMaskLayer);
222 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer->scroll ableArea() && m_owningLayer->scrollableArea()->horizontalScrollbar(); } 222 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer.scrolla bleArea() && m_owningLayer.scrollableArea()->horizontalScrollbar(); }
223 bool requiresVerticalScrollbarLayer() const { return m_owningLayer->scrollab leArea() && m_owningLayer->scrollableArea()->verticalScrollbar(); } 223 bool requiresVerticalScrollbarLayer() const { return m_owningLayer.scrollabl eArea() && m_owningLayer.scrollableArea()->verticalScrollbar(); }
224 bool requiresScrollCornerLayer() const { return m_owningLayer->scrollableAre a() && !m_owningLayer->scrollableArea()->scrollCornerAndResizerRect().isEmpty(); } 224 bool requiresScrollCornerLayer() const { return m_owningLayer.scrollableArea () && !m_owningLayer.scrollableArea()->scrollCornerAndResizerRect().isEmpty(); }
225 bool updateScrollingLayers(bool scrollingLayers); 225 bool updateScrollingLayers(bool scrollingLayers);
226 void updateScrollParent(RenderLayer*); 226 void updateScrollParent(RenderLayer*);
227 void updateClipParent(RenderLayer*); 227 void updateClipParent(RenderLayer*);
228 bool updateSquashingLayers(bool needsSquashingLayers); 228 bool updateSquashingLayers(bool needsSquashingLayers);
229 void updateDrawsContent(); 229 void updateDrawsContent();
230 void updateChildrenTransform(); 230 void updateChildrenTransform();
231 void registerScrollingLayers(); 231 void registerScrollingLayers();
232 232
233 void adjustBoundsForSubPixelAccumulation(const RenderLayer* compositedAncest or, IntRect& localCompositingBounds, IntRect& relativeCompositingBounds, IntPoin t& delta); 233 void adjustBoundsForSubPixelAccumulation(const RenderLayer* compositedAncest or, IntRect& localCompositingBounds, IntRect& relativeCompositingBounds, IntPoin t& delta);
234 234
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 void updateCompositingReasons(); 268 void updateCompositingReasons();
269 269
270 bool hasVisibleNonCompositingDescendantLayers() const; 270 bool hasVisibleNonCompositingDescendantLayers() const;
271 271
272 bool shouldClipCompositedBounds() const; 272 bool shouldClipCompositedBounds() const;
273 273
274 void paintsIntoCompositedAncestorChanged(); 274 void paintsIntoCompositedAncestorChanged();
275 275
276 void doPaintTask(GraphicsLayerPaintInfo&, GraphicsContext*, const IntRect& c lip); 276 void doPaintTask(GraphicsLayerPaintInfo&, GraphicsContext*, const IntRect& c lip);
277 277
278 RenderLayer* m_owningLayer; 278 RenderLayer& m_owningLayer;
279 279
280 // The hierarchy of layers that is maintained by the CompositedLayerMapping looks like this: 280 // The hierarchy of layers that is maintained by the CompositedLayerMapping looks like this:
281 // 281 //
282 // + m_ancestorClippingLayer [OPTIONAL] 282 // + m_ancestorClippingLayer [OPTIONAL]
283 // + m_graphicsLayer 283 // + m_graphicsLayer
284 // + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI ONAL] <-OR-> m_childTransformLayer 284 // + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI ONAL] <-OR-> m_childTransformLayer
285 // + m_scrollingContents Layer [OPTIONAL] 285 // + m_scrollingContents Layer [OPTIONAL]
286 // 286 //
287 // We need an ancestor clipping layer if our clipping ancestor is not our an cestor in the 287 // We need an ancestor clipping layer if our clipping ancestor is not our an cestor in the
288 // clipping tree. Here's what that might look like. 288 // clipping tree. Here's what that might look like.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 bool m_requiresOwnBackingStoreForAncestorReasons : 1; 359 bool m_requiresOwnBackingStoreForAncestorReasons : 1;
360 bool m_canCompositeFilters : 1; 360 bool m_canCompositeFilters : 1;
361 bool m_backgroundLayerPaintsFixedRootBackground : 1; 361 bool m_backgroundLayerPaintsFixedRootBackground : 1;
362 bool m_needToUpdateGeometry : 1; 362 bool m_needToUpdateGeometry : 1;
363 bool m_needToUpdateGeometryOfAllDecendants : 1; 363 bool m_needToUpdateGeometryOfAllDecendants : 1;
364 }; 364 };
365 365
366 } // namespace WebCore 366 } // namespace WebCore
367 367
368 #endif // CompositedLayerMapping_h 368 #endif // CompositedLayerMapping_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/compositing/CompositedLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698