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