| 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 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 m_scrollingContentsLayer->setOffsetFromRenderer(scrollingContentsOffset,
GraphicsLayer::DontSetNeedsDisplay); | 871 m_scrollingContentsLayer->setOffsetFromRenderer(scrollingContentsOffset,
GraphicsLayer::DontSetNeedsDisplay); |
| 872 | 872 |
| 873 if (m_foregroundLayer) { | 873 if (m_foregroundLayer) { |
| 874 if (m_foregroundLayer->size() != m_scrollingContentsLayer->size()) | 874 if (m_foregroundLayer->size() != m_scrollingContentsLayer->size()) |
| 875 m_foregroundLayer->setSize(m_scrollingContentsLayer->size()); | 875 m_foregroundLayer->setSize(m_scrollingContentsLayer->size()); |
| 876 m_foregroundLayer->setNeedsDisplay(); | 876 m_foregroundLayer->setNeedsDisplay(); |
| 877 m_foregroundLayer->setOffsetFromRenderer(m_scrollingContentsLayer->o
ffsetFromRenderer()); | 877 m_foregroundLayer->setOffsetFromRenderer(m_scrollingContentsLayer->o
ffsetFromRenderer()); |
| 878 } | 878 } |
| 879 } | 879 } |
| 880 | 880 |
| 881 updateSquashingLayerGeometry(delta); | 881 { |
| 882 IntPoint squashingDelta(delta); |
| 883 squashingDelta.moveBy(-graphicsLayerParentLocation); |
| 884 updateSquashingLayerGeometry(squashingDelta); |
| 885 } |
| 882 | 886 |
| 883 if (m_owningLayer.scrollableArea() && m_owningLayer.scrollableArea()->scroll
sOverflow()) | 887 if (m_owningLayer.scrollableArea() && m_owningLayer.scrollableArea()->scroll
sOverflow()) |
| 884 m_owningLayer.scrollableArea()->positionOverflowControls(); | 888 m_owningLayer.scrollableArea()->positionOverflowControls(); |
| 885 | 889 |
| 886 // We can't make this call in RenderLayerCompositor::allocateOrClearComposit
edLayerMapping | 890 // We can't make this call in RenderLayerCompositor::allocateOrClearComposit
edLayerMapping |
| 887 // since it depends on whether compAncestor draws content, which gets update
d later. | 891 // since it depends on whether compAncestor draws content, which gets update
d later. |
| 888 updateRequiresOwnBackingStoreForAncestorReasons(compAncestor); | 892 updateRequiresOwnBackingStoreForAncestorReasons(compAncestor); |
| 889 | 893 |
| 890 if (RuntimeEnabledFeatures::cssCompositingEnabled()) { | 894 if (RuntimeEnabledFeatures::cssCompositingEnabled()) { |
| 891 updateLayerBlendMode(style); | 895 updateLayerBlendMode(style); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 if (m_layerForHorizontalScrollbar) | 967 if (m_layerForHorizontalScrollbar) |
| 964 m_graphicsLayer->addChild(m_layerForHorizontalScrollbar.get()); | 968 m_graphicsLayer->addChild(m_layerForHorizontalScrollbar.get()); |
| 965 if (m_layerForVerticalScrollbar) | 969 if (m_layerForVerticalScrollbar) |
| 966 m_graphicsLayer->addChild(m_layerForVerticalScrollbar.get()); | 970 m_graphicsLayer->addChild(m_layerForVerticalScrollbar.get()); |
| 967 if (m_layerForScrollCorner) | 971 if (m_layerForScrollCorner) |
| 968 m_graphicsLayer->addChild(m_layerForScrollCorner.get()); | 972 m_graphicsLayer->addChild(m_layerForScrollCorner.get()); |
| 969 | 973 |
| 970 // The squashing containment layer, if it exists, becomes a no-op parent. | 974 // The squashing containment layer, if it exists, becomes a no-op parent. |
| 971 if (m_squashingLayer) { | 975 if (m_squashingLayer) { |
| 972 ASSERT(compositor()->layerSquashingEnabled()); | 976 ASSERT(compositor()->layerSquashingEnabled()); |
| 973 ASSERT(m_squashingContainmentLayer); | 977 ASSERT((m_ancestorClippingLayer && !m_squashingContainmentLayer) || (!m_
ancestorClippingLayer && m_squashingContainmentLayer)); |
| 974 | 978 |
| 975 m_squashingContainmentLayer->removeAllChildren(); | 979 if (m_squashingContainmentLayer) { |
| 976 | 980 m_squashingContainmentLayer->removeAllChildren(); |
| 977 if (m_ancestorClippingLayer) | |
| 978 m_squashingContainmentLayer->addChild(m_ancestorClippingLayer.get())
; | |
| 979 else | |
| 980 m_squashingContainmentLayer->addChild(m_graphicsLayer.get()); | 981 m_squashingContainmentLayer->addChild(m_graphicsLayer.get()); |
| 981 | 982 m_squashingContainmentLayer->addChild(m_squashingLayer.get()); |
| 982 m_squashingContainmentLayer->addChild(m_squashingLayer.get()); | 983 } else { |
| 984 // The ancestor clipping layer is already set up and has m_graphicsL
ayer under it. |
| 985 m_ancestorClippingLayer->addChild(m_squashingLayer.get()); |
| 986 } |
| 983 } | 987 } |
| 984 } | 988 } |
| 985 | 989 |
| 986 void CompositedLayerMapping::updateContentsRect() | 990 void CompositedLayerMapping::updateContentsRect() |
| 987 { | 991 { |
| 988 m_graphicsLayer->setContentsRect(pixelSnappedIntRect(contentsBox())); | 992 m_graphicsLayer->setContentsRect(pixelSnappedIntRect(contentsBox())); |
| 989 } | 993 } |
| 990 | 994 |
| 991 void CompositedLayerMapping::updateDrawsContent() | 995 void CompositedLayerMapping::updateDrawsContent() |
| 992 { | 996 { |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1452 if (needsSquashingLayers) { | 1456 if (needsSquashingLayers) { |
| 1453 ASSERT(compositor()->layerSquashingEnabled()); | 1457 ASSERT(compositor()->layerSquashingEnabled()); |
| 1454 | 1458 |
| 1455 if (!m_squashingLayer) { | 1459 if (!m_squashingLayer) { |
| 1456 ASSERT(!m_squashingContainmentLayer); | 1460 ASSERT(!m_squashingContainmentLayer); |
| 1457 | 1461 |
| 1458 m_squashingLayer = createGraphicsLayer(CompositingReasonLayerForSqua
shingContents); | 1462 m_squashingLayer = createGraphicsLayer(CompositingReasonLayerForSqua
shingContents); |
| 1459 m_squashingLayer->setDrawsContent(true); | 1463 m_squashingLayer->setDrawsContent(true); |
| 1460 | 1464 |
| 1461 // FIXME: containment layer needs a new CompositingReason, Compositi
ngReasonOverlap is not appropriate. | 1465 // FIXME: containment layer needs a new CompositingReason, Compositi
ngReasonOverlap is not appropriate. |
| 1462 m_squashingContainmentLayer = createGraphicsLayer(CompositingReasonL
ayerForSquashingContainer); | 1466 if (!m_ancestorClippingLayer) |
| 1467 m_squashingContainmentLayer = createGraphicsLayer(CompositingRea
sonLayerForSquashingContainer); |
| 1463 layersChanged = true; | 1468 layersChanged = true; |
| 1464 } | 1469 } |
| 1465 | 1470 |
| 1466 ASSERT(m_squashingLayer && m_squashingContainmentLayer); | 1471 ASSERT(m_squashingLayer); |
| 1467 } else { | 1472 } else { |
| 1468 if (m_squashingLayer) { | 1473 if (m_squashingLayer) { |
| 1469 m_squashingLayer->removeFromParent(); | 1474 m_squashingLayer->removeFromParent(); |
| 1470 m_squashingLayer = nullptr; | 1475 m_squashingLayer = nullptr; |
| 1471 // FIXME: do we need to invalidate something here? | 1476 layersChanged = true; |
| 1472 | 1477 } |
| 1473 ASSERT(m_squashingContainmentLayer); | 1478 if (m_squashingContainmentLayer) { |
| 1474 m_squashingContainmentLayer->removeFromParent(); | 1479 m_squashingContainmentLayer->removeFromParent(); |
| 1475 m_squashingContainmentLayer = nullptr; | 1480 m_squashingContainmentLayer = nullptr; |
| 1476 layersChanged = true; | 1481 layersChanged = true; |
| 1477 } | 1482 } |
| 1478 | |
| 1479 ASSERT(!m_squashingLayer && !m_squashingContainmentLayer); | 1483 ASSERT(!m_squashingLayer && !m_squashingContainmentLayer); |
| 1480 } | 1484 } |
| 1481 | 1485 |
| 1482 return layersChanged; | 1486 return layersChanged; |
| 1483 } | 1487 } |
| 1484 | 1488 |
| 1485 GraphicsLayerPaintingPhase CompositedLayerMapping::paintingPhaseForPrimaryLayer(
) const | 1489 GraphicsLayerPaintingPhase CompositedLayerMapping::paintingPhaseForPrimaryLayer(
) const |
| 1486 { | 1490 { |
| 1487 unsigned phase = 0; | 1491 unsigned phase = 0; |
| 1488 if (!m_backgroundLayer) | 1492 if (!m_backgroundLayer) |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2163 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2167 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
| 2164 name = "Scrolling Contents Layer"; | 2168 name = "Scrolling Contents Layer"; |
| 2165 } else { | 2169 } else { |
| 2166 ASSERT_NOT_REACHED(); | 2170 ASSERT_NOT_REACHED(); |
| 2167 } | 2171 } |
| 2168 | 2172 |
| 2169 return name; | 2173 return name; |
| 2170 } | 2174 } |
| 2171 | 2175 |
| 2172 } // namespace WebCore | 2176 } // namespace WebCore |
| OLD | NEW |