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