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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 GraphicsLayer* clippingLayer() const { return m_childContainmentLayer.get(); } | 110 GraphicsLayer* clippingLayer() const { return m_childContainmentLayer.get(); } |
111 | 111 |
112 // Layer to get clipped by ancestor | 112 // Layer to get clipped by ancestor |
113 bool hasAncestorClippingLayer() const { | 113 bool hasAncestorClippingLayer() const { |
114 return m_ancestorClippingLayer.get(); | 114 return m_ancestorClippingLayer.get(); |
115 } | 115 } |
116 GraphicsLayer* ancestorClippingLayer() const { | 116 GraphicsLayer* ancestorClippingLayer() const { |
117 return m_ancestorClippingLayer.get(); | 117 return m_ancestorClippingLayer.get(); |
118 } | 118 } |
119 | 119 |
| 120 GraphicsLayer* ancestorClippingMaskLayer() const { |
| 121 return m_ancestorClippingMaskLayer.get(); |
| 122 } |
| 123 |
120 GraphicsLayer* foregroundLayer() const { return m_foregroundLayer.get(); } | 124 GraphicsLayer* foregroundLayer() const { return m_foregroundLayer.get(); } |
121 | 125 |
122 GraphicsLayer* backgroundLayer() const { return m_backgroundLayer.get(); } | 126 GraphicsLayer* backgroundLayer() const { return m_backgroundLayer.get(); } |
123 | 127 |
124 GraphicsLayer* decorationOutlineLayer() const { | 128 GraphicsLayer* decorationOutlineLayer() const { |
125 return m_decorationOutlineLayer.get(); | 129 return m_decorationOutlineLayer.get(); |
126 } | 130 } |
127 | 131 |
128 bool backgroundLayerPaintsFixedRootBackground() const { | 132 bool backgroundLayerPaintsFixedRootBackground() const { |
129 return m_backgroundLayerPaintsFixedRootBackground; | 133 return m_backgroundLayerPaintsFixedRootBackground; |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 LayoutBoxModelObject* layoutObject() const { | 380 LayoutBoxModelObject* layoutObject() const { |
377 return m_owningLayer.layoutObject(); | 381 return m_owningLayer.layoutObject(); |
378 } | 382 } |
379 PaintLayerCompositor* compositor() const { | 383 PaintLayerCompositor* compositor() const { |
380 return m_owningLayer.compositor(); | 384 return m_owningLayer.compositor(); |
381 } | 385 } |
382 | 386 |
383 void updateInternalHierarchy(); | 387 void updateInternalHierarchy(); |
384 void updatePaintingPhases(); | 388 void updatePaintingPhases(); |
385 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip); | 389 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip); |
| 390 bool updateClippingLayers(bool needsAncestorClip, |
| 391 bool needsAncestorClippingMask, |
| 392 bool needsDescendantClip); |
386 bool updateChildTransformLayer(bool needsChildTransformLayer); | 393 bool updateChildTransformLayer(bool needsChildTransformLayer); |
387 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, | 394 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, |
388 bool needsVerticalScrollbarLayer, | 395 bool needsVerticalScrollbarLayer, |
389 bool needsScrollCornerLayer, | 396 bool needsScrollCornerLayer, |
390 bool needsAncestorClip); | 397 bool needsAncestorClip); |
391 bool updateForegroundLayer(bool needsForegroundLayer); | 398 bool updateForegroundLayer(bool needsForegroundLayer); |
392 bool updateBackgroundLayer(bool needsBackgroundLayer); | 399 bool updateBackgroundLayer(bool needsBackgroundLayer); |
393 bool updateDecorationOutlineLayer(bool needsDecorationOutlineLayer); | 400 bool updateDecorationOutlineLayer(bool needsDecorationOutlineLayer); |
394 bool updateMaskLayer(bool needsMaskLayer); | 401 bool updateMaskLayer(bool needsMaskLayer); |
395 void updateChildClippingMaskLayer(bool needsChildClippingMaskLayer); | 402 void updateChildClippingMaskLayer(bool needsChildClippingMaskLayer); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 // contains this squashed layer's clipping ancestor. The clip rect is | 477 // contains this squashed layer's clipping ancestor. The clip rect is |
471 // returned in the coordinate space of the given squashed layer. If there is | 478 // returned in the coordinate space of the given squashed layer. If there is |
472 // no such containing layer, returns the infinite rect. | 479 // no such containing layer, returns the infinite rect. |
473 // FIXME: unify this code with the code that sets up m_ancestorClippingLayer. | 480 // FIXME: unify this code with the code that sets up m_ancestorClippingLayer. |
474 // They are doing very similar things. | 481 // They are doing very similar things. |
475 static IntRect localClipRectForSquashedLayer( | 482 static IntRect localClipRectForSquashedLayer( |
476 const PaintLayer& referenceLayer, | 483 const PaintLayer& referenceLayer, |
477 const GraphicsLayerPaintInfo&, | 484 const GraphicsLayerPaintInfo&, |
478 const Vector<GraphicsLayerPaintInfo>& layers); | 485 const Vector<GraphicsLayerPaintInfo>& layers); |
479 | 486 |
480 // Return true if |m_owningLayer|'s compositing ancestor is not a descendant | 487 // Return true in |owningLayerIsClipped| iff |m_owningLayer|'s compositing |
481 // (inclusive) of the clipping container for |m_owningLayer|. | 488 // ancestor is not a descendant (inclusive) of the clipping container for |
482 bool owningLayerClippedByLayerNotAboveCompositedAncestor( | 489 // |m_owningLayer|. Return true in |owningLayerIsMasked| iff |
483 const PaintLayer* scrollParent); | 490 // |owningLayerIsClipped| is true and |m_owningLayer|'s compositing ancestor |
| 491 // is not a descendant (inclusive) of a container that applies a mask for |
| 492 // |m_owningLayer|. |
| 493 void owningLayerClippedOrMaskedByLayerNotAboveCompositedAncestor( |
| 494 const PaintLayer* scrollParent, |
| 495 bool& owningLayerIsClipped, |
| 496 bool& owningLayerIsMasked); |
484 | 497 |
485 const PaintLayer* scrollParent(); | 498 const PaintLayer* scrollParent(); |
486 | 499 |
487 // Clear the groupedMapping entry on the layer at the given index, only if | 500 // Clear the groupedMapping entry on the layer at the given index, only if |
488 // that layer does not appear earlier in the set of layers for this object. | 501 // that layer does not appear earlier in the set of layers for this object. |
489 bool invalidateLayerIfNoPrecedingEntry(size_t); | 502 bool invalidateLayerIfNoPrecedingEntry(size_t); |
490 | 503 |
491 PaintLayer& m_owningLayer; | 504 PaintLayer& m_owningLayer; |
492 | 505 |
493 // The hierarchy of layers that is maintained by the CompositedLayerMapping | 506 // The hierarchy of layers that is maintained by the CompositedLayerMapping |
(...skipping 28 matching lines...) Expand all Loading... |
522 // | + ... | 535 // | + ... |
523 // ... | 536 // ... |
524 // | | 537 // | |
525 // + B = m_ancestorClippingLayer [+] | 538 // + B = m_ancestorClippingLayer [+] |
526 // + m_graphicsLayer | 539 // + m_graphicsLayer |
527 // + ... | 540 // + ... |
528 // | 541 // |
529 // In this case B is clipped by another layer that doesn't happen to be its | 542 // In this case B is clipped by another layer that doesn't happen to be its |
530 // ancestor: A. So we create an ancestor clipping layer for B, [+], which | 543 // ancestor: A. So we create an ancestor clipping layer for B, [+], which |
531 // ensures that B is clipped as if it had been A's descendant. | 544 // ensures that B is clipped as if it had been A's descendant. |
| 545 // In addition, the m_ancestorClippingLayer will have an associated |
| 546 // mask layer if the ancestor, A, has a border radius that requires a |
| 547 // rounded corner clip rect. The mask is not part of the layer tree; rather |
| 548 // it is attached to the m_ancestorClippingLayer itself. |
| 549 // |
| 550 // Layers that require a CSS mask also have a mask layer attached to them. |
532 | 551 |
533 // Only used if we are clipped by an ancestor which is not a stacking context. | 552 // Only used if we are clipped by an ancestor which is not a stacking context. |
534 std::unique_ptr<GraphicsLayer> m_ancestorClippingLayer; | 553 std::unique_ptr<GraphicsLayer> m_ancestorClippingLayer; |
| 554 |
| 555 // Only used is there is an m_ancestorClippingLayer that also needs to apply |
| 556 // a clipping mask (for CSS clips or border radius). |
| 557 std::unique_ptr<GraphicsLayer> m_ancestorClippingMaskLayer; |
| 558 |
535 std::unique_ptr<GraphicsLayer> m_graphicsLayer; | 559 std::unique_ptr<GraphicsLayer> m_graphicsLayer; |
536 | 560 |
537 // Only used if we have clipping on a stacking context with compositing | 561 // Only used if we have clipping on a stacking context with compositing |
538 // children. | 562 // children. |
539 std::unique_ptr<GraphicsLayer> m_childContainmentLayer; | 563 std::unique_ptr<GraphicsLayer> m_childContainmentLayer; |
540 | 564 |
541 // Only used if we have perspective. | 565 // Only used if we have perspective. |
542 std::unique_ptr<GraphicsLayer> m_childTransformLayer; | 566 std::unique_ptr<GraphicsLayer> m_childTransformLayer; |
543 | 567 |
544 // Only used if the layer is using composited scrolling. | 568 // Only used if the layer is using composited scrolling. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 // layer and the graphics layer because the scrolling contents layer is | 691 // layer and the graphics layer because the scrolling contents layer is |
668 // clipped by the padding box. | 692 // clipped by the padding box. |
669 unsigned m_backgroundPaintsOntoGraphicsLayer : 1; | 693 unsigned m_backgroundPaintsOntoGraphicsLayer : 1; |
670 | 694 |
671 friend class CompositedLayerMappingTest; | 695 friend class CompositedLayerMappingTest; |
672 }; | 696 }; |
673 | 697 |
674 } // namespace blink | 698 } // namespace blink |
675 | 699 |
676 #endif // CompositedLayerMapping_h | 700 #endif // CompositedLayerMapping_h |
OLD | NEW |