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