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