| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 bool hasAncestorClippingLayer() const { | 112 bool hasAncestorClippingLayer() const { |
| 113 return m_ancestorClippingLayer.get(); | 113 return m_ancestorClippingLayer.get(); |
| 114 } | 114 } |
| 115 GraphicsLayer* ancestorClippingLayer() const { | 115 GraphicsLayer* ancestorClippingLayer() const { |
| 116 return m_ancestorClippingLayer.get(); | 116 return m_ancestorClippingLayer.get(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 GraphicsLayer* foregroundLayer() const { return m_foregroundLayer.get(); } | 119 GraphicsLayer* foregroundLayer() const { return m_foregroundLayer.get(); } |
| 120 | 120 |
| 121 GraphicsLayer* backgroundLayer() const { return m_backgroundLayer.get(); } | 121 GraphicsLayer* backgroundLayer() const { return m_backgroundLayer.get(); } |
| 122 |
| 123 GraphicsLayer* decorationLayer() const { return m_decorationLayer.get(); } |
| 124 |
| 122 bool backgroundLayerPaintsFixedRootBackground() const { | 125 bool backgroundLayerPaintsFixedRootBackground() const { |
| 123 return m_backgroundLayerPaintsFixedRootBackground; | 126 return m_backgroundLayerPaintsFixedRootBackground; |
| 124 } | 127 } |
| 125 | 128 |
| 126 bool hasScrollingLayer() const { return m_scrollingLayer.get(); } | 129 bool hasScrollingLayer() const { return m_scrollingLayer.get(); } |
| 127 GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); } | 130 GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); } |
| 128 GraphicsLayer* scrollingContentsLayer() const { | 131 GraphicsLayer* scrollingContentsLayer() const { |
| 129 return m_scrollingContentsLayer.get(); | 132 return m_scrollingContentsLayer.get(); |
| 130 } | 133 } |
| 131 | 134 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 void updateChildTransformLayerGeometry(); | 348 void updateChildTransformLayerGeometry(); |
| 346 void updateMaskLayerGeometry(); | 349 void updateMaskLayerGeometry(); |
| 347 void updateTransformGeometry( | 350 void updateTransformGeometry( |
| 348 const IntPoint& snappedOffsetFromCompositedAncestor, | 351 const IntPoint& snappedOffsetFromCompositedAncestor, |
| 349 const IntRect& relativeCompositingBounds); | 352 const IntRect& relativeCompositingBounds); |
| 350 void updateForegroundLayerGeometry( | 353 void updateForegroundLayerGeometry( |
| 351 const FloatSize& relativeCompositingBoundsSize, | 354 const FloatSize& relativeCompositingBoundsSize, |
| 352 const IntRect& clippingBox); | 355 const IntRect& clippingBox); |
| 353 void updateBackgroundLayerGeometry( | 356 void updateBackgroundLayerGeometry( |
| 354 const FloatSize& relativeCompositingBoundsSize); | 357 const FloatSize& relativeCompositingBoundsSize); |
| 358 void updateDecorationLayerGeometry( |
| 359 const FloatSize& relativeCompositingBoundsSize); |
| 355 void updateScrollingLayerGeometry(const IntRect& localCompositingBounds); | 360 void updateScrollingLayerGeometry(const IntRect& localCompositingBounds); |
| 356 void updateChildClippingMaskLayerGeometry(); | 361 void updateChildClippingMaskLayerGeometry(); |
| 357 | 362 |
| 358 void createPrimaryGraphicsLayer(); | 363 void createPrimaryGraphicsLayer(); |
| 359 void destroyGraphicsLayers(); | 364 void destroyGraphicsLayers(); |
| 360 | 365 |
| 361 std::unique_ptr<GraphicsLayer> createGraphicsLayer( | 366 std::unique_ptr<GraphicsLayer> createGraphicsLayer( |
| 362 CompositingReasons, | 367 CompositingReasons, |
| 363 SquashingDisallowedReasons = SquashingDisallowedReasonsNone); | 368 SquashingDisallowedReasons = SquashingDisallowedReasonsNone); |
| 364 bool toggleScrollbarLayerIfNeeded(std::unique_ptr<GraphicsLayer>&, | 369 bool toggleScrollbarLayerIfNeeded(std::unique_ptr<GraphicsLayer>&, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 375 void updateInternalHierarchy(); | 380 void updateInternalHierarchy(); |
| 376 void updatePaintingPhases(); | 381 void updatePaintingPhases(); |
| 377 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip); | 382 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip); |
| 378 bool updateChildTransformLayer(bool needsChildTransformLayer); | 383 bool updateChildTransformLayer(bool needsChildTransformLayer); |
| 379 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, | 384 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, |
| 380 bool needsVerticalScrollbarLayer, | 385 bool needsVerticalScrollbarLayer, |
| 381 bool needsScrollCornerLayer, | 386 bool needsScrollCornerLayer, |
| 382 bool needsAncestorClip); | 387 bool needsAncestorClip); |
| 383 bool updateForegroundLayer(bool needsForegroundLayer); | 388 bool updateForegroundLayer(bool needsForegroundLayer); |
| 384 bool updateBackgroundLayer(bool needsBackgroundLayer); | 389 bool updateBackgroundLayer(bool needsBackgroundLayer); |
| 390 bool updateDecorationLayer(bool needsDecorationLayer); |
| 385 bool updateMaskLayer(bool needsMaskLayer); | 391 bool updateMaskLayer(bool needsMaskLayer); |
| 386 void updateChildClippingMaskLayer(bool needsChildClippingMaskLayer); | 392 void updateChildClippingMaskLayer(bool needsChildClippingMaskLayer); |
| 387 bool requiresHorizontalScrollbarLayer() const { | 393 bool requiresHorizontalScrollbarLayer() const { |
| 388 return m_owningLayer.getScrollableArea() && | 394 return m_owningLayer.getScrollableArea() && |
| 389 m_owningLayer.getScrollableArea()->horizontalScrollbar(); | 395 m_owningLayer.getScrollableArea()->horizontalScrollbar(); |
| 390 } | 396 } |
| 391 bool requiresVerticalScrollbarLayer() const { | 397 bool requiresVerticalScrollbarLayer() const { |
| 392 return m_owningLayer.getScrollableArea() && | 398 return m_owningLayer.getScrollableArea() && |
| 393 m_owningLayer.getScrollableArea()->verticalScrollbar(); | 399 m_owningLayer.getScrollableArea()->verticalScrollbar(); |
| 394 } | 400 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 // The hierarchy of layers that is maintained by the CompositedLayerMapping | 490 // The hierarchy of layers that is maintained by the CompositedLayerMapping |
| 485 // looks like this: | 491 // looks like this: |
| 486 // | 492 // |
| 487 // + m_ancestorClippingLayer [OPTIONAL] | 493 // + m_ancestorClippingLayer [OPTIONAL] |
| 488 // + m_graphicsLayer | 494 // + m_graphicsLayer |
| 489 // + m_childTransformLayer [OPTIONAL] | 495 // + m_childTransformLayer [OPTIONAL] |
| 490 // | + m_childContainmentLayer [OPTIONAL] | 496 // | + m_childContainmentLayer [OPTIONAL] |
| 491 // | <-OR-> | 497 // | <-OR-> |
| 492 // | (m_scrollingLayer + m_scrollingContentsLayer) [OPTIONAL] | 498 // | (m_scrollingLayer + m_scrollingContentsLayer) [OPTIONAL] |
| 493 // + m_overflowControlsAncestorClippingLayer [OPTIONAL] | 499 // + m_overflowControlsAncestorClippingLayer [OPTIONAL] |
| 494 // + m_overflowControlsHostLayer [OPTIONAL] | 500 // | + m_overflowControlsHostLayer [OPTIONAL] |
| 495 // + m_layerForVerticalScrollbar [OPTIONAL] | 501 // | + m_layerForVerticalScrollbar [OPTIONAL] |
| 496 // + m_layerForHorizontalScrollbar [OPTIONAL] | 502 // | + m_layerForHorizontalScrollbar [OPTIONAL] |
| 497 // + m_layerForScrollCorner [OPTIONAL] | 503 // | + m_layerForScrollCorner [OPTIONAL] |
| 504 // + m_decorationLayer [OPTIONAL] |
| 498 // The overflow controls may need to be repositioned in the graphics layer | 505 // The overflow controls may need to be repositioned in the graphics layer |
| 499 // tree by the RLC to ensure that they stack above scrolling content. | 506 // tree by the RLC to ensure that they stack above scrolling content. |
| 500 // | 507 // |
| 501 // We need an ancestor clipping layer if our clipping ancestor is not our | 508 // We need an ancestor clipping layer if our clipping ancestor is not our |
| 502 // ancestor in the clipping tree. Here's what that might look like. | 509 // ancestor in the clipping tree. Here's what that might look like. |
| 503 // | 510 // |
| 504 // Let A = the clipping ancestor, | 511 // Let A = the clipping ancestor, |
| 505 // B = the clip descendant, and | 512 // B = the clip descendant, and |
| 506 // SC = the stacking context that is the ancestor of A and B in the | 513 // SC = the stacking context that is the ancestor of A and B in the |
| 507 // stacking tree. | 514 // stacking tree. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 | 599 |
| 593 // The reparented overflow controls sometimes need to be clipped by a | 600 // The reparented overflow controls sometimes need to be clipped by a |
| 594 // non-ancestor. In just the same way we need an ancestor clipping layer to | 601 // non-ancestor. In just the same way we need an ancestor clipping layer to |
| 595 // clip this CLM's internal hierarchy, we add another layer to clip the | 602 // clip this CLM's internal hierarchy, we add another layer to clip the |
| 596 // overflow controls. We could combine this with m_overflowControlsHostLayer, | 603 // overflow controls. We could combine this with m_overflowControlsHostLayer, |
| 597 // but that would require manually intersecting their clips, and shifting the | 604 // but that would require manually intersecting their clips, and shifting the |
| 598 // overflow controls to compensate for this clip's offset. By using a separate | 605 // overflow controls to compensate for this clip's offset. By using a separate |
| 599 // layer, the overflow controls can remain ignorant of ancestor clipping. | 606 // layer, the overflow controls can remain ignorant of ancestor clipping. |
| 600 std::unique_ptr<GraphicsLayer> m_overflowControlsAncestorClippingLayer; | 607 std::unique_ptr<GraphicsLayer> m_overflowControlsAncestorClippingLayer; |
| 601 | 608 |
| 609 // DecorationLayer which includes painting of outline etc. |
| 610 std::unique_ptr<GraphicsLayer> m_decorationLayer; |
| 611 |
| 602 // A squashing CLM has two possible squashing-related structures. | 612 // A squashing CLM has two possible squashing-related structures. |
| 603 // | 613 // |
| 604 // If m_ancestorClippingLayer is present: | 614 // If m_ancestorClippingLayer is present: |
| 605 // | 615 // |
| 606 // m_ancestorClippingLayer | 616 // m_ancestorClippingLayer |
| 607 // + m_graphicsLayer | 617 // + m_graphicsLayer |
| 608 // + m_squashingLayer | 618 // + m_squashingLayer |
| 609 // | 619 // |
| 610 // If not: | 620 // If not: |
| 611 // | 621 // |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 // Keep track of whether the background is painted onto the scrolling contents | 659 // Keep track of whether the background is painted onto the scrolling contents |
| 650 // layer for invalidations. | 660 // layer for invalidations. |
| 651 unsigned m_backgroundPaintsOntoScrollingContentsLayer : 1; | 661 unsigned m_backgroundPaintsOntoScrollingContentsLayer : 1; |
| 652 | 662 |
| 653 friend class CompositedLayerMappingTest; | 663 friend class CompositedLayerMappingTest; |
| 654 }; | 664 }; |
| 655 | 665 |
| 656 } // namespace blink | 666 } // namespace blink |
| 657 | 667 |
| 658 #endif // CompositedLayerMapping_h | 668 #endif // CompositedLayerMapping_h |
| OLD | NEW |