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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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. |
532 | 545 |
533 // Only used if we are clipped by an ancestor which is not a stacking context. | 546 // Only used if we are clipped by an ancestor which is not a stacking context. |
534 std::unique_ptr<GraphicsLayer> m_ancestorClippingLayer; | 547 std::unique_ptr<GraphicsLayer> m_ancestorClippingLayer; |
548 | |
549 // Only used is there is an m_ancestorClippingLayer that also needs to apply | |
550 // a clipping mask (for CSS clips or border radius). | |
551 std::unique_ptr<GraphicsLayer> m_ancestorClippingMaskLayer; | |
552 | |
535 std::unique_ptr<GraphicsLayer> m_graphicsLayer; | 553 std::unique_ptr<GraphicsLayer> m_graphicsLayer; |
536 | 554 |
537 // Only used if we have clipping on a stacking context with compositing | 555 // Only used if we have clipping on a stacking context with compositing |
538 // children. | 556 // children. |
539 std::unique_ptr<GraphicsLayer> m_childContainmentLayer; | 557 std::unique_ptr<GraphicsLayer> m_childContainmentLayer; |
540 | 558 |
541 // Only used if we have perspective. | 559 // Only used if we have perspective. |
542 std::unique_ptr<GraphicsLayer> m_childTransformLayer; | 560 std::unique_ptr<GraphicsLayer> m_childTransformLayer; |
543 | 561 |
544 // Only used if the layer is using composited scrolling. | 562 // Only used if the layer is using composited scrolling. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
609 // layer, the overflow controls can remain ignorant of ancestor clipping. | 627 // layer, the overflow controls can remain ignorant of ancestor clipping. |
610 std::unique_ptr<GraphicsLayer> m_overflowControlsAncestorClippingLayer; | 628 std::unique_ptr<GraphicsLayer> m_overflowControlsAncestorClippingLayer; |
611 | 629 |
612 // DecorationLayer which paints outline. | 630 // DecorationLayer which paints outline. |
613 std::unique_ptr<GraphicsLayer> m_decorationOutlineLayer; | 631 std::unique_ptr<GraphicsLayer> m_decorationOutlineLayer; |
614 | 632 |
615 // A squashing CLM has two possible squashing-related structures. | 633 // A squashing CLM has two possible squashing-related structures. |
616 // | 634 // |
617 // If m_ancestorClippingLayer is present: | 635 // If m_ancestorClippingLayer is present: |
618 // | 636 // |
619 // m_ancestorClippingLayer | 637 // m_ancestorClippingLayer |
chrishtr
2016/12/07 19:16:24
Please update this chart.
| |
620 // + m_graphicsLayer | 638 // + m_graphicsLayer |
621 // + m_squashingLayer | 639 // + m_squashingLayer |
622 // | 640 // |
623 // If not: | 641 // If not: |
624 // | 642 // |
625 // m_squashingContainmentLayer | 643 // m_squashingContainmentLayer |
626 // + m_graphicsLayer | 644 // + m_graphicsLayer |
627 // + m_squashingLayer | 645 // + m_squashingLayer |
628 // | 646 // |
629 // Stacking children of a squashed layer receive graphics layers that are | 647 // Stacking children of a squashed layer receive graphics layers that are |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
667 // layer and the graphics layer because the scrolling contents layer is | 685 // layer and the graphics layer because the scrolling contents layer is |
668 // clipped by the padding box. | 686 // clipped by the padding box. |
669 unsigned m_backgroundPaintsOntoGraphicsLayer : 1; | 687 unsigned m_backgroundPaintsOntoGraphicsLayer : 1; |
670 | 688 |
671 friend class CompositedLayerMappingTest; | 689 friend class CompositedLayerMappingTest; |
672 }; | 690 }; |
673 | 691 |
674 } // namespace blink | 692 } // namespace blink |
675 | 693 |
676 #endif // CompositedLayerMapping_h | 694 #endif // CompositedLayerMapping_h |
OLD | NEW |