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

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: remove -expected.txt 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 LayoutSize contentOffsetInCompositingLayer() const; 202 LayoutSize contentOffsetInCompositingLayer() const;
202 203
203 LayoutPoint squashingOffsetFromTransformedAncestor() 204 LayoutPoint squashingOffsetFromTransformedAncestor()
204 { 205 {
205 return m_squashingLayerOffsetFromTransformedAncestor; 206 return m_squashingLayerOffsetFromTransformedAncestor;
206 } 207 }
207 208
208 // If there is a squashed layer painting into this CLM that is an ancestor o f the given RenderObject, return it. Otherwise return 0. 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.
209 const GraphicsLayerPaintInfo* containingSquashedLayer(const RenderObject*); 210 const GraphicsLayerPaintInfo* containingSquashedLayer(const RenderObject*);
210 211
212 void updateScrollingBlockSelection();
213
211 private: 214 private:
212 static const GraphicsLayerPaintInfo* containingSquashedLayer(const RenderObj ect*, const Vector<GraphicsLayerPaintInfo>& layers); 215 static const GraphicsLayerPaintInfo* containingSquashedLayer(const RenderObj ect*, const Vector<GraphicsLayerPaintInfo>& layers);
213 216
214 // Helper methods to updateGraphicsLayerGeometry: 217 // Helper methods to updateGraphicsLayerGeometry:
215 void computeGraphicsLayerParentLocation(const RenderLayer* compositingContai ner, const IntRect& ancestorCompositingBounds, IntPoint& graphicsLayerParentLoca tion); 218 void computeGraphicsLayerParentLocation(const RenderLayer* compositingContai ner, const IntRect& ancestorCompositingBounds, IntPoint& graphicsLayerParentLoca tion);
216 void updateSquashingLayerGeometry(const LayoutPoint& offsetFromCompositedAnc estor, const IntPoint& graphicsLayerParentLocation, const RenderLayer& reference Layer, Vector<GraphicsLayerPaintInfo>& layers, GraphicsLayer*, LayoutPoint* offs etFromTransformedAncestor); 219 void updateSquashingLayerGeometry(const LayoutPoint& offsetFromCompositedAnc estor, const IntPoint& graphicsLayerParentLocation, const RenderLayer& reference Layer, Vector<GraphicsLayerPaintInfo>& layers, GraphicsLayer*, LayoutPoint* offs etFromTransformedAncestor);
217 void updateMainGraphicsLayerGeometry(const IntRect& relativeCompositingBound s, const IntRect& localCompositingBounds, IntPoint& graphicsLayerParentLocation) ; 220 void updateMainGraphicsLayerGeometry(const IntRect& relativeCompositingBound s, const IntRect& localCompositingBounds, IntPoint& graphicsLayerParentLocation) ;
218 void updateAncestorClippingLayerGeometry(const RenderLayer* compositingConta iner, const IntPoint& snappedOffsetFromCompositedAncestor, IntPoint& graphicsLay erParentLocation); 221 void updateAncestorClippingLayerGeometry(const RenderLayer* compositingConta iner, const IntPoint& snappedOffsetFromCompositedAncestor, IntPoint& graphicsLay erParentLocation);
219 void updateChildContainmentLayerGeometry(const IntRect& clippingBox, const I ntRect& localCompositingBounds); 222 void updateChildContainmentLayerGeometry(const IntRect& clippingBox, const I ntRect& localCompositingBounds);
220 void updateChildTransformLayerGeometry(); 223 void updateChildTransformLayerGeometry();
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 static IntRect localClipRectForSquashedLayer(const RenderLayer& referenceLay er, const GraphicsLayerPaintInfo&, const Vector<GraphicsLayerPaintInfo>& layers ); 305 static IntRect localClipRectForSquashedLayer(const RenderLayer& referenceLay er, const GraphicsLayerPaintInfo&, const Vector<GraphicsLayerPaintInfo>& layers );
303 306
304 RenderLayer& m_owningLayer; 307 RenderLayer& m_owningLayer;
305 308
306 // The hierarchy of layers that is maintained by the CompositedLayerMapping looks like this: 309 // The hierarchy of layers that is maintained by the CompositedLayerMapping looks like this:
307 // 310 //
308 // + m_ancestorClippingLayer [OPTIONAL] 311 // + m_ancestorClippingLayer [OPTIONAL]
309 // + m_graphicsLayer 312 // + m_graphicsLayer
310 // + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI ONAL] <-OR-> m_childTransformLayer 313 // + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI ONAL] <-OR-> m_childTransformLayer
311 // + m_scrollingContents Layer [Present iff m_scrollingLayer is present] 314 // + m_scrollingContents Layer [Present iff m_scrollingLayer is present]
315 // + m_scrollingBlock SelectionLayer [Present iff m_scrollingLayer is present]
312 // 316 //
313 // We need an ancestor clipping layer if our clipping ancestor is not our an cestor in the 317 // We need an ancestor clipping layer if our clipping ancestor is not our an cestor in the
314 // clipping tree. Here's what that might look like. 318 // clipping tree. Here's what that might look like.
315 // 319 //
316 // Let A = the clipping ancestor, 320 // Let A = the clipping ancestor,
317 // B = the clip descendant, and 321 // B = the clip descendant, and
318 // SC = the stacking context that is the ancestor of A and B in the stac king tree. 322 // SC = the stacking context that is the ancestor of A and B in the stac king tree.
319 // 323 //
320 // SC 324 // SC
321 // + A = m_graphicsLayer 325 // + A = m_graphicsLayer
322 // | + m_childContainmentLayer 326 // | + m_childContainmentLayer
323 // | + ... 327 // | + ...
324 // ... 328 // ...
325 // | 329 // |
326 // + B = m_ancestorClippingLayer [+] 330 // + B = m_ancestorClippingLayer [+]
327 // + m_graphicsLayer 331 // + m_graphicsLayer
328 // + ... 332 // + ...
329 // 333 //
330 // In this case B is clipped by another layer that doesn't happen to be its ancestor: A. 334 // In this case B is clipped by another layer that doesn't happen to be its ancestor: A.
331 // So we create an ancestor clipping layer for B, [+], which ensures that B is clipped 335 // So we create an ancestor clipping layer for B, [+], which ensures that B is clipped
332 // as if it had been A's descendant. 336 // as if it had been A's descendant.
333 OwnPtr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clippe d by an ancestor which is not a stacking context. 337 OwnPtr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clippe d by an ancestor which is not a stacking context.
334 OwnPtr<GraphicsLayer> m_graphicsLayer; 338 OwnPtr<GraphicsLayer> m_graphicsLayer;
335 OwnPtr<GraphicsLayer> m_childContainmentLayer; // Only used if we have clipp ing on a stacking context with compositing children. 339 OwnPtr<GraphicsLayer> m_childContainmentLayer; // Only used if we have clipp ing on a stacking context with compositing children.
336 OwnPtr<GraphicsLayer> m_childTransformLayer; // Only used if we have perspec tive and no m_childContainmentLayer. 340 OwnPtr<GraphicsLayer> m_childTransformLayer; // Only used if we have perspec tive and no m_childContainmentLayer.
337 OwnPtr<GraphicsLayer> m_scrollingLayer; // Only used if the layer is using c omposited scrolling. 341 OwnPtr<GraphicsLayer> m_scrollingLayer; // Only used if the layer is using c omposited scrolling.
338 OwnPtr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is using composited scrolling. 342 OwnPtr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is using composited scrolling.
343 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.
339 344
340 // This layer is also added to the hierarchy by the RLB, but in a different way than 345 // This layer is also added to the hierarchy by the RLB, but in a different way than
341 // the layers above. It's added to m_graphicsLayer as its mask layer (natura lly) if 346 // the layers above. It's added to m_graphicsLayer as its mask layer (natura lly) if
342 // we have a mask, and isn't part of the typical hierarchy (it has no childr en). 347 // we have a mask, and isn't part of the typical hierarchy (it has no childr en).
343 OwnPtr<GraphicsLayer> m_maskLayer; // Only used if we have a mask. 348 OwnPtr<GraphicsLayer> m_maskLayer; // Only used if we have a mask.
344 OwnPtr<GraphicsLayer> m_childClippingMaskLayer; // Only used if we have to c lip child layers or accelerated contents with border radius or clip-path. 349 OwnPtr<GraphicsLayer> m_childClippingMaskLayer; // Only used if we have to c lip child layers or accelerated contents with border radius or clip-path.
345 350
346 // There are two other (optional) layers whose painting is managed by the Co mpositedLayerMapping, 351 // There are two other (optional) layers whose painting is managed by the Co mpositedLayerMapping,
347 // but whose position in the hierarchy is maintained by the RenderLayerCompo sitor. These 352 // but whose position in the hierarchy is maintained by the RenderLayerCompo sitor. These
348 // are the foreground and background layers. The foreground layer exists if we have composited 353 // 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
392 397
393 LayoutRect m_compositedBounds; 398 LayoutRect m_compositedBounds;
394 399
395 bool m_isMainFrameRenderViewLayer : 1; 400 bool m_isMainFrameRenderViewLayer : 1;
396 bool m_requiresOwnBackingStoreForIntrinsicReasons : 1; 401 bool m_requiresOwnBackingStoreForIntrinsicReasons : 1;
397 bool m_requiresOwnBackingStoreForAncestorReasons : 1; 402 bool m_requiresOwnBackingStoreForAncestorReasons : 1;
398 bool m_canCompositeFilters : 1; 403 bool m_canCompositeFilters : 1;
399 bool m_backgroundLayerPaintsFixedRootBackground : 1; 404 bool m_backgroundLayerPaintsFixedRootBackground : 1;
400 bool m_needToUpdateGraphicsLayer : 1; 405 bool m_needToUpdateGraphicsLayer : 1;
401 bool m_needToUpdateGraphicsLayerOfAllDecendants : 1; 406 bool m_needToUpdateGraphicsLayerOfAllDecendants : 1;
407 bool m_scrollingContentsAreEmpty : 1;
402 }; 408 };
403 409
404 } // namespace WebCore 410 } // namespace WebCore
405 411
406 #endif // CompositedLayerMapping_h 412 #endif // CompositedLayerMapping_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698