| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 bool isolate = m_owningLayer.shouldIsolateCompositedDescendants(); | 290 bool isolate = m_owningLayer.shouldIsolateCompositedDescendants(); |
| 291 | 291 |
| 292 // non stacking context layers should never isolate | 292 // non stacking context layers should never isolate |
| 293 ASSERT(m_owningLayer.stackingNode()->isStackingContext() || !isolate); | 293 ASSERT(m_owningLayer.stackingNode()->isStackingContext() || !isolate); |
| 294 | 294 |
| 295 m_graphicsLayer->setIsRootForIsolatedGroup(isolate); | 295 m_graphicsLayer->setIsRootForIsolatedGroup(isolate); |
| 296 } | 296 } |
| 297 | 297 |
| 298 void CompositedLayerMapping::updateBackgroundPaintsOntoScrollingContentsLayer() | 298 void CompositedLayerMapping::updateBackgroundPaintsOntoScrollingContentsLayer() |
| 299 { | 299 { |
| 300 bool shouldPaintOntoScrollingContentsLayer = shouldPaintBackgroundOntoScroll
ingContentsLayer(); | 300 bool shouldPaintOntoScrollingContentsLayer = m_owningLayer.shouldPaintBackgr
oundOntoScrollingContentsLayer(); |
| 301 if (shouldPaintOntoScrollingContentsLayer != backgroundPaintsOntoScrollingCo
ntentsLayer()) { | 301 if (shouldPaintOntoScrollingContentsLayer != backgroundPaintsOntoScrollingCo
ntentsLayer()) { |
| 302 m_backgroundPaintsOntoScrollingContentsLayer = shouldPaintOntoScrollingC
ontentsLayer; | 302 m_backgroundPaintsOntoScrollingContentsLayer = shouldPaintOntoScrollingC
ontentsLayer; |
| 303 // If the background is no longer painted onto the scrolling contents | 303 // If the background is no longer painted onto the scrolling contents |
| 304 // layer the scrolling contents layer needs to be updated. If it is | 304 // layer the scrolling contents layer needs to be updated. If it is |
| 305 // going to be painted onto the scrolling contents layer this update | 305 // going to be painted onto the scrolling contents layer this update |
| 306 // will be triggered by LayoutBoxModelObject::setBackingNeedsPaintInvali
dationInRect | 306 // will be triggered by LayoutBoxModelObject::setBackingNeedsPaintInvali
dationInRect |
| 307 if (hasScrollingLayer() && !shouldPaintOntoScrollingContentsLayer) | 307 if (hasScrollingLayer() && !shouldPaintOntoScrollingContentsLayer) |
| 308 m_scrollingContentsLayer->setNeedsDisplay(); | 308 m_scrollingContentsLayer->setNeedsDisplay(); |
| 309 } | 309 } |
| 310 } | 310 } |
| (...skipping 2267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2578 if (m_squashedLayers[previousIndex].paintLayer == layerToRemove) | 2578 if (m_squashedLayers[previousIndex].paintLayer == layerToRemove) |
| 2579 break; | 2579 break; |
| 2580 } | 2580 } |
| 2581 if (previousIndex == indexToClear && layerToRemove->groupedMapping() == this
) { | 2581 if (previousIndex == indexToClear && layerToRemove->groupedMapping() == this
) { |
| 2582 compositor()->paintInvalidationOnCompositingChange(layerToRemove); | 2582 compositor()->paintInvalidationOnCompositingChange(layerToRemove); |
| 2583 return true; | 2583 return true; |
| 2584 } | 2584 } |
| 2585 return false; | 2585 return false; |
| 2586 } | 2586 } |
| 2587 | 2587 |
| 2588 bool CompositedLayerMapping::shouldPaintBackgroundOntoScrollingContentsLayer() c
onst | |
| 2589 { | |
| 2590 // TODO(flackr): Add support for painting locally attached background images
. https://crbug.com/625882 | |
| 2591 const FillLayer& backgroundLayer = m_owningLayer.layoutObject()->style()->ba
ckgroundLayers(); | |
| 2592 return !m_owningLayer.isRootLayer() | |
| 2593 && m_owningLayer.scrollsOverflow() | |
| 2594 && !backgroundLayer.image() | |
| 2595 && !backgroundLayer.next() | |
| 2596 && (backgroundLayer.attachment() == LocalBackgroundAttachment | |
| 2597 || backgroundLayer.clip() == PaddingFillBox) | |
| 2598 && !m_owningLayer.stackingNode()->hasNegativeZOrderList(); | |
| 2599 } | |
| 2600 | |
| 2601 bool CompositedLayerMapping::updateSquashingLayerAssignment(PaintLayer* squashed
Layer, size_t nextSquashedLayerIndex) | 2588 bool CompositedLayerMapping::updateSquashingLayerAssignment(PaintLayer* squashed
Layer, size_t nextSquashedLayerIndex) |
| 2602 { | 2589 { |
| 2603 GraphicsLayerPaintInfo paintInfo; | 2590 GraphicsLayerPaintInfo paintInfo; |
| 2604 paintInfo.paintLayer = squashedLayer; | 2591 paintInfo.paintLayer = squashedLayer; |
| 2605 // NOTE: composited bounds are updated elsewhere | 2592 // NOTE: composited bounds are updated elsewhere |
| 2606 // NOTE: offsetFromLayoutObject is updated elsewhere | 2593 // NOTE: offsetFromLayoutObject is updated elsewhere |
| 2607 | 2594 |
| 2608 // Change tracking on squashing layers: at the first sign of something chang
ed, just invalidate the layer. | 2595 // Change tracking on squashing layers: at the first sign of something chang
ed, just invalidate the layer. |
| 2609 // FIXME: Perhaps we can find a tighter more clever mechanism later. | 2596 // FIXME: Perhaps we can find a tighter more clever mechanism later. |
| 2610 if (nextSquashedLayerIndex < m_squashedLayers.size()) { | 2597 if (nextSquashedLayerIndex < m_squashedLayers.size()) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2711 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2698 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
| 2712 name = "Scrolling Contents Layer"; | 2699 name = "Scrolling Contents Layer"; |
| 2713 } else { | 2700 } else { |
| 2714 ASSERT_NOT_REACHED(); | 2701 ASSERT_NOT_REACHED(); |
| 2715 } | 2702 } |
| 2716 | 2703 |
| 2717 return name; | 2704 return name; |
| 2718 } | 2705 } |
| 2719 | 2706 |
| 2720 } // namespace blink | 2707 } // namespace blink |
| OLD | NEW |