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