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