Chromium Code Reviews| 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 368 LayoutBoxModelObject* layoutObject() const { | 368 LayoutBoxModelObject* layoutObject() const { |
| 369 return m_owningLayer.layoutObject(); | 369 return m_owningLayer.layoutObject(); |
| 370 } | 370 } |
| 371 PaintLayerCompositor* compositor() const { | 371 PaintLayerCompositor* compositor() const { |
| 372 return m_owningLayer.compositor(); | 372 return m_owningLayer.compositor(); |
| 373 } | 373 } |
| 374 | 374 |
| 375 void updateInternalHierarchy(); | 375 void updateInternalHierarchy(); |
| 376 void updatePaintingPhases(); | 376 void updatePaintingPhases(); |
| 377 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip); | 377 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip); |
| 378 bool updateClippingLayers(bool needsAncestorClip, | |
| 379 bool needsAncestorClippingMask, | |
| 380 bool needsDescendantClip); | |
| 378 bool updateChildTransformLayer(bool needsChildTransformLayer); | 381 bool updateChildTransformLayer(bool needsChildTransformLayer); |
| 379 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, | 382 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, |
| 380 bool needsVerticalScrollbarLayer, | 383 bool needsVerticalScrollbarLayer, |
| 381 bool needsScrollCornerLayer, | 384 bool needsScrollCornerLayer, |
| 382 bool needsAncestorClip); | 385 bool needsAncestorClip); |
| 383 bool updateForegroundLayer(bool needsForegroundLayer); | 386 bool updateForegroundLayer(bool needsForegroundLayer); |
| 384 bool updateBackgroundLayer(bool needsBackgroundLayer); | 387 bool updateBackgroundLayer(bool needsBackgroundLayer); |
| 385 bool updateMaskLayer(bool needsMaskLayer); | 388 bool updateMaskLayer(bool needsMaskLayer); |
| 386 void updateChildClippingMaskLayer(bool needsChildClippingMaskLayer); | 389 void updateChildClippingMaskLayer(bool needsChildClippingMaskLayer); |
| 387 bool requiresHorizontalScrollbarLayer() const { | 390 bool requiresHorizontalScrollbarLayer() const { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 461 // contains this squashed layer's clipping ancestor. The clip rect is | 464 // contains this squashed layer's clipping ancestor. The clip rect is |
| 462 // returned in the coordinate space of the given squashed layer. If there is | 465 // returned in the coordinate space of the given squashed layer. If there is |
| 463 // no such containing layer, returns the infinite rect. | 466 // no such containing layer, returns the infinite rect. |
| 464 // FIXME: unify this code with the code that sets up m_ancestorClippingLayer. | 467 // FIXME: unify this code with the code that sets up m_ancestorClippingLayer. |
| 465 // They are doing very similar things. | 468 // They are doing very similar things. |
| 466 static IntRect localClipRectForSquashedLayer( | 469 static IntRect localClipRectForSquashedLayer( |
| 467 const PaintLayer& referenceLayer, | 470 const PaintLayer& referenceLayer, |
| 468 const GraphicsLayerPaintInfo&, | 471 const GraphicsLayerPaintInfo&, |
| 469 const Vector<GraphicsLayerPaintInfo>& layers); | 472 const Vector<GraphicsLayerPaintInfo>& layers); |
| 470 | 473 |
| 471 // Return true if |m_owningLayer|'s compositing ancestor is not a descendant | 474 // Return true in |owningLayerIsClipped| iff |m_owningLayer|'s compositing |
| 472 // (inclusive) of the clipping container for |m_owningLayer|. | 475 // ancestor is not a descendant (inclusive) of the clipping container for |
| 473 bool owningLayerClippedByLayerNotAboveCompositedAncestor( | 476 // |m_owningLayer|. Return true in |owningLayerIsMasked| iff |
| 474 const PaintLayer* scrollParent); | 477 // |owningLayerIsClipped| is true and |m_owningLayer|'s compositing ancestor |
| 478 // is not a descendant (inclusive) of a container that applies a mask for | |
| 479 // |m_owningLayer|. | |
| 480 void owningLayerClippedOrMaskedByLayerNotAboveCompositedAncestor( | |
| 481 const PaintLayer* scrollParent, | |
| 482 bool& owningLayerIsClipped, | |
| 483 bool& owningLayerIsMasked); | |
|
Stephen Chennney
2016/11/08 21:42:51
Not sure if it's a good idea to set two things wit
| |
| 475 | 484 |
| 476 const PaintLayer* scrollParent(); | 485 const PaintLayer* scrollParent(); |
| 477 | 486 |
| 478 // 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 |
| 479 // 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. |
| 480 bool invalidateLayerIfNoPrecedingEntry(size_t); | 489 bool invalidateLayerIfNoPrecedingEntry(size_t); |
| 481 | 490 |
| 482 PaintLayer& m_owningLayer; | 491 PaintLayer& m_owningLayer; |
| 483 | 492 |
| 484 // The hierarchy of layers that is maintained by the CompositedLayerMapping | 493 // The hierarchy of layers that is maintained by the CompositedLayerMapping |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 515 // + B = m_ancestorClippingLayer [+] | 524 // + B = m_ancestorClippingLayer [+] |
| 516 // + m_graphicsLayer | 525 // + m_graphicsLayer |
| 517 // + ... | 526 // + ... |
| 518 // | 527 // |
| 519 // In this case B is clipped by another layer that doesn't happen to be its | 528 // In this case B is clipped by another layer that doesn't happen to be its |
| 520 // ancestor: A. So we create an ancestor clipping layer for B, [+], which | 529 // ancestor: A. So we create an ancestor clipping layer for B, [+], which |
| 521 // ensures that B is clipped as if it had been A's descendant. | 530 // ensures that B is clipped as if it had been A's descendant. |
| 522 | 531 |
| 523 // Only used if we are clipped by an ancestor which is not a stacking context. | 532 // Only used if we are clipped by an ancestor which is not a stacking context. |
| 524 std::unique_ptr<GraphicsLayer> m_ancestorClippingLayer; | 533 std::unique_ptr<GraphicsLayer> m_ancestorClippingLayer; |
| 534 | |
| 535 // Only used is there is an m_ancestorClippingLayer that also needs to apply | |
| 536 // a clipping mask (for CSS clips or border radius). | |
| 537 std::unique_ptr<GraphicsLayer> m_ancestorClippingMaskLayer; | |
| 538 | |
| 525 std::unique_ptr<GraphicsLayer> m_graphicsLayer; | 539 std::unique_ptr<GraphicsLayer> m_graphicsLayer; |
| 526 | 540 |
| 527 // Only used if we have clipping on a stacking context with compositing | 541 // Only used if we have clipping on a stacking context with compositing |
| 528 // children. | 542 // children. |
| 529 std::unique_ptr<GraphicsLayer> m_childContainmentLayer; | 543 std::unique_ptr<GraphicsLayer> m_childContainmentLayer; |
| 530 | 544 |
| 531 // Only used if we have perspective. | 545 // Only used if we have perspective. |
| 532 std::unique_ptr<GraphicsLayer> m_childTransformLayer; | 546 std::unique_ptr<GraphicsLayer> m_childTransformLayer; |
| 533 | 547 |
| 534 // Only used if the layer is using composited scrolling. | 548 // Only used if the layer is using composited scrolling. |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 649 // Keep track of whether the background is painted onto the scrolling contents | 663 // Keep track of whether the background is painted onto the scrolling contents |
| 650 // layer for invalidations. | 664 // layer for invalidations. |
| 651 unsigned m_backgroundPaintsOntoScrollingContentsLayer : 1; | 665 unsigned m_backgroundPaintsOntoScrollingContentsLayer : 1; |
| 652 | 666 |
| 653 friend class CompositedLayerMappingTest; | 667 friend class CompositedLayerMappingTest; |
| 654 }; | 668 }; |
| 655 | 669 |
| 656 } // namespace blink | 670 } // namespace blink |
| 657 | 671 |
| 658 #endif // CompositedLayerMapping_h | 672 #endif // CompositedLayerMapping_h |
| OLD | NEW |