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

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

Issue 303253004: Allow proper highlighting on universal overflow scroll. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add commented lifecycle assert Created 6 years, 6 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 | 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 bool hasContentsLayer() const { return m_foregroundLayer; } 105 bool hasContentsLayer() const { return m_foregroundLayer; }
106 GraphicsLayer* foregroundLayer() const { return m_foregroundLayer.get(); } 106 GraphicsLayer* foregroundLayer() const { return m_foregroundLayer.get(); }
107 107
108 GraphicsLayer* backgroundLayer() const { return m_backgroundLayer.get(); } 108 GraphicsLayer* backgroundLayer() const { return m_backgroundLayer.get(); }
109 bool backgroundLayerPaintsFixedRootBackground() const { return m_backgroundL ayerPaintsFixedRootBackground; } 109 bool backgroundLayerPaintsFixedRootBackground() const { return m_backgroundL ayerPaintsFixedRootBackground; }
110 110
111 bool hasScrollingLayer() const { return m_scrollingLayer; } 111 bool hasScrollingLayer() const { return m_scrollingLayer; }
112 GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); } 112 GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); }
113 GraphicsLayer* scrollingContentsLayer() const { return m_scrollingContentsLa yer.get(); } 113 GraphicsLayer* scrollingContentsLayer() const { return m_scrollingContentsLa yer.get(); }
114 GraphicsLayer* scrollingBlockSelectionLayer() const { return m_scrollingBloc kSelectionLayer.get(); }
114 115
115 bool hasMaskLayer() const { return m_maskLayer; } 116 bool hasMaskLayer() const { return m_maskLayer; }
116 GraphicsLayer* maskLayer() const { return m_maskLayer.get(); } 117 GraphicsLayer* maskLayer() const { return m_maskLayer.get(); }
117 118
118 bool hasChildClippingMaskLayer() const { return m_childClippingMaskLayer; } 119 bool hasChildClippingMaskLayer() const { return m_childClippingMaskLayer; }
119 GraphicsLayer* childClippingMaskLayer() const { return m_childClippingMaskLa yer.get(); } 120 GraphicsLayer* childClippingMaskLayer() const { return m_childClippingMaskLa yer.get(); }
120 121
121 GraphicsLayer* parentForSublayers() const; 122 GraphicsLayer* parentForSublayers() const;
122 GraphicsLayer* childForSuperlayers() const; 123 GraphicsLayer* childForSuperlayers() const;
123 // localRootForOwningLayer does not include the m_squashingContainmentLayer, which is technically not associated with this CLM's owning layer. 124 // localRootForOwningLayer does not include the m_squashingContainmentLayer, which is technically not associated with this CLM's owning layer.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 LayoutSize contentOffsetInCompositingLayer() const; 203 LayoutSize contentOffsetInCompositingLayer() const;
203 204
204 LayoutPoint squashingOffsetFromTransformedAncestor() 205 LayoutPoint squashingOffsetFromTransformedAncestor()
205 { 206 {
206 return m_squashingLayerOffsetFromTransformedAncestor; 207 return m_squashingLayerOffsetFromTransformedAncestor;
207 } 208 }
208 209
209 // If there is a squashed layer painting into this CLM that is an ancestor o f the given RenderObject, return it. Otherwise return 0. 210 // If there is a squashed layer painting into this CLM that is an ancestor o f the given RenderObject, return it. Otherwise return 0.
210 const GraphicsLayerPaintInfo* containingSquashedLayer(const RenderObject*); 211 const GraphicsLayerPaintInfo* containingSquashedLayer(const RenderObject*);
211 212
213 void updateScrollingBlockSelection();
214
212 private: 215 private:
213 static const GraphicsLayerPaintInfo* containingSquashedLayer(const RenderObj ect*, const Vector<GraphicsLayerPaintInfo>& layers); 216 static const GraphicsLayerPaintInfo* containingSquashedLayer(const RenderObj ect*, const Vector<GraphicsLayerPaintInfo>& layers);
214 217
215 // Helper methods to updateGraphicsLayerGeometry: 218 // Helper methods to updateGraphicsLayerGeometry:
216 void computeGraphicsLayerParentLocation(const RenderLayer* compositingContai ner, const IntRect& ancestorCompositingBounds, IntPoint& graphicsLayerParentLoca tion); 219 void computeGraphicsLayerParentLocation(const RenderLayer* compositingContai ner, const IntRect& ancestorCompositingBounds, IntPoint& graphicsLayerParentLoca tion);
217 void updateSquashingLayerGeometry(const LayoutPoint& offsetFromCompositedAnc estor, const IntPoint& graphicsLayerParentLocation, const RenderLayer& reference Layer, Vector<GraphicsLayerPaintInfo>& layers, GraphicsLayer*, LayoutPoint* offs etFromTransformedAncestor); 220 void updateSquashingLayerGeometry(const LayoutPoint& offsetFromCompositedAnc estor, const IntPoint& graphicsLayerParentLocation, const RenderLayer& reference Layer, Vector<GraphicsLayerPaintInfo>& layers, GraphicsLayer*, LayoutPoint* offs etFromTransformedAncestor);
218 void updateMainGraphicsLayerGeometry(const IntRect& relativeCompositingBound s, const IntRect& localCompositingBounds, IntPoint& graphicsLayerParentLocation) ; 221 void updateMainGraphicsLayerGeometry(const IntRect& relativeCompositingBound s, const IntRect& localCompositingBounds, IntPoint& graphicsLayerParentLocation) ;
219 void updateAncestorClippingLayerGeometry(const RenderLayer* compositingConta iner, const IntPoint& snappedOffsetFromCompositedAncestor, IntPoint& graphicsLay erParentLocation); 222 void updateAncestorClippingLayerGeometry(const RenderLayer* compositingConta iner, const IntPoint& snappedOffsetFromCompositedAncestor, IntPoint& graphicsLay erParentLocation);
220 void updateChildContainmentLayerGeometry(const IntRect& clippingBox, const I ntRect& localCompositingBounds); 223 void updateChildContainmentLayerGeometry(const IntRect& clippingBox, const I ntRect& localCompositingBounds);
221 void updateChildTransformLayerGeometry(); 224 void updateChildTransformLayerGeometry();
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 static IntRect localClipRectForSquashedLayer(const RenderLayer& referenceLay er, const GraphicsLayerPaintInfo&, const Vector<GraphicsLayerPaintInfo>& layers ); 306 static IntRect localClipRectForSquashedLayer(const RenderLayer& referenceLay er, const GraphicsLayerPaintInfo&, const Vector<GraphicsLayerPaintInfo>& layers );
304 307
305 RenderLayer& m_owningLayer; 308 RenderLayer& m_owningLayer;
306 309
307 // The hierarchy of layers that is maintained by the CompositedLayerMapping looks like this: 310 // The hierarchy of layers that is maintained by the CompositedLayerMapping looks like this:
308 // 311 //
309 // + m_ancestorClippingLayer [OPTIONAL] 312 // + m_ancestorClippingLayer [OPTIONAL]
310 // + m_graphicsLayer 313 // + m_graphicsLayer
311 // + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI ONAL] <-OR-> m_childTransformLayer 314 // + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI ONAL] <-OR-> m_childTransformLayer
312 // + m_scrollingContents Layer [Present iff m_scrollingLayer is present] 315 // + m_scrollingContents Layer [Present iff m_scrollingLayer is present]
316 // + m_scrollingBlock SelectionLayer [Present iff m_scrollingLayer is present]
313 // 317 //
314 // We need an ancestor clipping layer if our clipping ancestor is not our an cestor in the 318 // We need an ancestor clipping layer if our clipping ancestor is not our an cestor in the
315 // clipping tree. Here's what that might look like. 319 // clipping tree. Here's what that might look like.
316 // 320 //
317 // Let A = the clipping ancestor, 321 // Let A = the clipping ancestor,
318 // B = the clip descendant, and 322 // B = the clip descendant, and
319 // SC = the stacking context that is the ancestor of A and B in the stac king tree. 323 // SC = the stacking context that is the ancestor of A and B in the stac king tree.
320 // 324 //
321 // SC 325 // SC
322 // + A = m_graphicsLayer 326 // + A = m_graphicsLayer
323 // | + m_childContainmentLayer 327 // | + m_childContainmentLayer
324 // | + ... 328 // | + ...
325 // ... 329 // ...
326 // | 330 // |
327 // + B = m_ancestorClippingLayer [+] 331 // + B = m_ancestorClippingLayer [+]
328 // + m_graphicsLayer 332 // + m_graphicsLayer
329 // + ... 333 // + ...
330 // 334 //
331 // In this case B is clipped by another layer that doesn't happen to be its ancestor: A. 335 // In this case B is clipped by another layer that doesn't happen to be its ancestor: A.
332 // So we create an ancestor clipping layer for B, [+], which ensures that B is clipped 336 // So we create an ancestor clipping layer for B, [+], which ensures that B is clipped
333 // as if it had been A's descendant. 337 // as if it had been A's descendant.
334 OwnPtr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clippe d by an ancestor which is not a stacking context. 338 OwnPtr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clippe d by an ancestor which is not a stacking context.
335 OwnPtr<GraphicsLayer> m_graphicsLayer; 339 OwnPtr<GraphicsLayer> m_graphicsLayer;
336 OwnPtr<GraphicsLayer> m_childContainmentLayer; // Only used if we have clipp ing on a stacking context with compositing children. 340 OwnPtr<GraphicsLayer> m_childContainmentLayer; // Only used if we have clipp ing on a stacking context with compositing children.
337 OwnPtr<GraphicsLayer> m_childTransformLayer; // Only used if we have perspec tive and no m_childContainmentLayer. 341 OwnPtr<GraphicsLayer> m_childTransformLayer; // Only used if we have perspec tive and no m_childContainmentLayer.
338 OwnPtr<GraphicsLayer> m_scrollingLayer; // Only used if the layer is using c omposited scrolling. 342 OwnPtr<GraphicsLayer> m_scrollingLayer; // Only used if the layer is using c omposited scrolling.
339 OwnPtr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is using composited scrolling. 343 OwnPtr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is using composited scrolling.
344 OwnPtr<GraphicsLayer> m_scrollingBlockSelectionLayer; // Only used if the la yer is using composited scrolling, but has no scrolling contents apart from bloc k selection gaps.
340 345
341 // This layer is also added to the hierarchy by the RLB, but in a different way than 346 // This layer is also added to the hierarchy by the RLB, but in a different way than
342 // the layers above. It's added to m_graphicsLayer as its mask layer (natura lly) if 347 // the layers above. It's added to m_graphicsLayer as its mask layer (natura lly) if
343 // we have a mask, and isn't part of the typical hierarchy (it has no childr en). 348 // we have a mask, and isn't part of the typical hierarchy (it has no childr en).
344 OwnPtr<GraphicsLayer> m_maskLayer; // Only used if we have a mask. 349 OwnPtr<GraphicsLayer> m_maskLayer; // Only used if we have a mask.
345 OwnPtr<GraphicsLayer> m_childClippingMaskLayer; // Only used if we have to c lip child layers or accelerated contents with border radius or clip-path. 350 OwnPtr<GraphicsLayer> m_childClippingMaskLayer; // Only used if we have to c lip child layers or accelerated contents with border radius or clip-path.
346 351
347 // There are two other (optional) layers whose painting is managed by the Co mpositedLayerMapping, 352 // There are two other (optional) layers whose painting is managed by the Co mpositedLayerMapping,
348 // but whose position in the hierarchy is maintained by the RenderLayerCompo sitor. These 353 // but whose position in the hierarchy is maintained by the RenderLayerCompo sitor. These
349 // are the foreground and background layers. The foreground layer exists if we have composited 354 // are the foreground and background layers. The foreground layer exists if we have composited
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 398
394 LayoutRect m_compositedBounds; 399 LayoutRect m_compositedBounds;
395 400
396 bool m_isMainFrameRenderViewLayer : 1; 401 bool m_isMainFrameRenderViewLayer : 1;
397 bool m_requiresOwnBackingStoreForIntrinsicReasons : 1; 402 bool m_requiresOwnBackingStoreForIntrinsicReasons : 1;
398 bool m_requiresOwnBackingStoreForAncestorReasons : 1; 403 bool m_requiresOwnBackingStoreForAncestorReasons : 1;
399 bool m_canCompositeFilters : 1; 404 bool m_canCompositeFilters : 1;
400 bool m_backgroundLayerPaintsFixedRootBackground : 1; 405 bool m_backgroundLayerPaintsFixedRootBackground : 1;
401 bool m_needToUpdateGraphicsLayer : 1; 406 bool m_needToUpdateGraphicsLayer : 1;
402 bool m_needToUpdateGraphicsLayerOfAllDecendants : 1; 407 bool m_needToUpdateGraphicsLayerOfAllDecendants : 1;
408 bool m_scrollingContentsAreEmpty : 1;
403 }; 409 };
404 410
405 } // namespace WebCore 411 } // namespace WebCore
406 412
407 #endif // CompositedLayerMapping_h 413 #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