| 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 | 472 |
| 473 if (updateForegroundLayer(compositor->needsContentsCompositingLayer(&m_ownin
gLayer))) | 473 if (updateForegroundLayer(compositor->needsContentsCompositingLayer(&m_ownin
gLayer))) |
| 474 layerConfigChanged = true; | 474 layerConfigChanged = true; |
| 475 | 475 |
| 476 bool needsDescendentsClippingLayer = compositor->clipsCompositingDescendants
(&m_owningLayer); | 476 bool needsDescendentsClippingLayer = compositor->clipsCompositingDescendants
(&m_owningLayer); |
| 477 | 477 |
| 478 // Our scrolling layer will clip. | 478 // Our scrolling layer will clip. |
| 479 if (m_owningLayer.needsCompositedScrolling()) | 479 if (m_owningLayer.needsCompositedScrolling()) |
| 480 needsDescendentsClippingLayer = false; | 480 needsDescendentsClippingLayer = false; |
| 481 | 481 |
| 482 RenderLayer* scrollParent = m_owningLayer.scrollParent(); | 482 RenderLayer* scrollParent = renderer->compositorDrivenAcceleratedScrollingEn
abled() ? m_owningLayer.scrollParent() : 0; |
| 483 bool needsAncestorClip = compositor->clippedByAncestor(&m_owningLayer); | 483 bool needsAncestorClip = compositor->clippedByAncestor(&m_owningLayer); |
| 484 if (scrollParent) { | 484 if (scrollParent) { |
| 485 // If our containing block is our ancestor scrolling layer, then we'll a
lready be clipped | 485 // If our containing block is our ancestor scrolling layer, then we'll a
lready be clipped |
| 486 // to it via our scroll parent and we don't need an ancestor clipping la
yer. | 486 // to it via our scroll parent and we don't need an ancestor clipping la
yer. |
| 487 if (m_owningLayer.renderer()->containingBlock()->enclosingLayer() == m_o
wningLayer.ancestorCompositedScrollingLayer()) | 487 if (m_owningLayer.renderer()->containingBlock()->enclosingLayer() == m_o
wningLayer.ancestorCompositedScrollingLayer()) |
| 488 needsAncestorClip = false; | 488 needsAncestorClip = false; |
| 489 } | 489 } |
| 490 | 490 |
| 491 if (updateClippingLayers(needsAncestorClip, needsDescendentsClippingLayer)) | 491 if (updateClippingLayers(needsAncestorClip, needsDescendentsClippingLayer)) |
| 492 layerConfigChanged = true; | 492 layerConfigChanged = true; |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 | 894 |
| 895 updateHasGpuRasterizationHint(renderer()->style()); | 895 updateHasGpuRasterizationHint(renderer()->style()); |
| 896 updateContentsRect(); | 896 updateContentsRect(); |
| 897 updateBackgroundColor(); | 897 updateBackgroundColor(); |
| 898 updateDrawsContent(); | 898 updateDrawsContent(); |
| 899 updateContentsOpaque(); | 899 updateContentsOpaque(); |
| 900 updateAfterWidgetResize(); | 900 updateAfterWidgetResize(); |
| 901 updateRenderingContext(); | 901 updateRenderingContext(); |
| 902 updateShouldFlattenTransform(); | 902 updateShouldFlattenTransform(); |
| 903 updateChildrenTransform(); | 903 updateChildrenTransform(); |
| 904 updateScrollParent(m_owningLayer.scrollParent()); | 904 updateScrollParent(renderer()->compositorDrivenAcceleratedScrollingEnabled()
? m_owningLayer.scrollParent() : 0); |
| 905 registerScrollingLayers(); | 905 registerScrollingLayers(); |
| 906 | 906 |
| 907 updateCompositingReasons(); | 907 updateCompositingReasons(); |
| 908 | 908 |
| 909 return updateType; | 909 return updateType; |
| 910 } | 910 } |
| 911 | 911 |
| 912 void CompositedLayerMapping::registerScrollingLayers() | 912 void CompositedLayerMapping::registerScrollingLayers() |
| 913 { | 913 { |
| 914 // Register fixed position layers and their containers with the scrolling co
ordinator. | 914 // Register fixed position layers and their containers with the scrolling co
ordinator. |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1421 | 1421 |
| 1422 // Only the topmost layer has a scroll parent. All other layers have a null
scroll parent. | 1422 // Only the topmost layer has a scroll parent. All other layers have a null
scroll parent. |
| 1423 if (layer != topmostLayer) | 1423 if (layer != topmostLayer) |
| 1424 scrollParent = 0; | 1424 scrollParent = 0; |
| 1425 | 1425 |
| 1426 scrollingCoordinator->updateScrollParentForGraphicsLayer(layer, scrollParent
); | 1426 scrollingCoordinator->updateScrollParentForGraphicsLayer(layer, scrollParent
); |
| 1427 } | 1427 } |
| 1428 | 1428 |
| 1429 void CompositedLayerMapping::updateScrollParent(RenderLayer* scrollParent) | 1429 void CompositedLayerMapping::updateScrollParent(RenderLayer* scrollParent) |
| 1430 { | 1430 { |
| 1431 if (!scrollParent && m_squashedLayers.size()) | 1431 if (!scrollParent && m_squashedLayers.size() && renderer()->compositorDriven
AcceleratedScrollingEnabled()) |
| 1432 scrollParent = m_squashedLayers[0].renderLayer->scrollParent(); | 1432 scrollParent = m_squashedLayers[0].renderLayer->scrollParent(); |
| 1433 | 1433 |
| 1434 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay
er(m_owningLayer)) { | 1434 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay
er(m_owningLayer)) { |
| 1435 GraphicsLayer* topmostLayer = childForSuperlayers(); | 1435 GraphicsLayer* topmostLayer = childForSuperlayers(); |
| 1436 updateScrollParentForGraphicsLayer(m_squashingContainmentLayer.get(), to
pmostLayer, scrollParent, scrollingCoordinator); | 1436 updateScrollParentForGraphicsLayer(m_squashingContainmentLayer.get(), to
pmostLayer, scrollParent, scrollingCoordinator); |
| 1437 updateScrollParentForGraphicsLayer(m_ancestorClippingLayer.get(), topmos
tLayer, scrollParent, scrollingCoordinator); | 1437 updateScrollParentForGraphicsLayer(m_ancestorClippingLayer.get(), topmos
tLayer, scrollParent, scrollingCoordinator); |
| 1438 updateScrollParentForGraphicsLayer(m_graphicsLayer.get(), topmostLayer,
scrollParent, scrollingCoordinator); | 1438 updateScrollParentForGraphicsLayer(m_graphicsLayer.get(), topmostLayer,
scrollParent, scrollingCoordinator); |
| 1439 } | 1439 } |
| 1440 } | 1440 } |
| 1441 | 1441 |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2163 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2163 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
| 2164 name = "Scrolling Contents Layer"; | 2164 name = "Scrolling Contents Layer"; |
| 2165 } else { | 2165 } else { |
| 2166 ASSERT_NOT_REACHED(); | 2166 ASSERT_NOT_REACHED(); |
| 2167 } | 2167 } |
| 2168 | 2168 |
| 2169 return name; | 2169 return name; |
| 2170 } | 2170 } |
| 2171 | 2171 |
| 2172 } // namespace WebCore | 2172 } // namespace WebCore |
| OLD | NEW |