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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 | 456 |
457 if (updateForegroundLayer(compositor->needsContentsCompositingLayer(&m_ownin
gLayer))) | 457 if (updateForegroundLayer(compositor->needsContentsCompositingLayer(&m_ownin
gLayer))) |
458 layerConfigChanged = true; | 458 layerConfigChanged = true; |
459 | 459 |
460 bool needsDescendentsClippingLayer = compositor->clipsCompositingDescendants
(&m_owningLayer); | 460 bool needsDescendentsClippingLayer = compositor->clipsCompositingDescendants
(&m_owningLayer); |
461 | 461 |
462 // Our scrolling layer will clip. | 462 // Our scrolling layer will clip. |
463 if (m_owningLayer.needsCompositedScrolling()) | 463 if (m_owningLayer.needsCompositedScrolling()) |
464 needsDescendentsClippingLayer = false; | 464 needsDescendentsClippingLayer = false; |
465 | 465 |
| 466 // FIXME: this should not be computed dynamically, but passed down during th
e compositing update. |
| 467 // See http://crbug.com/351851 |
466 RenderLayer* scrollParent = m_owningLayer.scrollParent(); | 468 RenderLayer* scrollParent = m_owningLayer.scrollParent(); |
467 bool needsAncestorClip = compositor->clippedByAncestor(&m_owningLayer); | 469 bool needsAncestorClip = compositor->clippedByAncestor(&m_owningLayer); |
468 if (scrollParent) { | 470 if (scrollParent) { |
469 // If our containing block is our ancestor scrolling layer, then we'll a
lready be clipped | 471 // If our containing block is our ancestor scrolling layer, then we'll a
lready be clipped |
470 // to it via our scroll parent and we don't need an ancestor clipping la
yer. | 472 // to it via our scroll parent and we don't need an ancestor clipping la
yer. |
471 if (m_owningLayer.renderer()->containingBlock()->enclosingLayer() == m_o
wningLayer.ancestorCompositedScrollingLayer()) | 473 if (m_owningLayer.renderer()->containingBlock()->enclosingLayer() == m_o
wningLayer.ancestorCompositedScrollingLayer()) |
472 needsAncestorClip = false; | 474 needsAncestorClip = false; |
473 } | 475 } |
474 | 476 |
475 if (updateClippingLayers(needsAncestorClip, needsDescendentsClippingLayer)) | 477 if (updateClippingLayers(needsAncestorClip, needsDescendentsClippingLayer)) |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 | 865 |
864 updateHasGpuRasterizationHint(renderer()->style()); | 866 updateHasGpuRasterizationHint(renderer()->style()); |
865 updateContentsRect(); | 867 updateContentsRect(); |
866 updateBackgroundColor(); | 868 updateBackgroundColor(); |
867 updateDrawsContent(); | 869 updateDrawsContent(); |
868 updateContentsOpaque(); | 870 updateContentsOpaque(); |
869 updateAfterWidgetResize(); | 871 updateAfterWidgetResize(); |
870 updateRenderingContext(); | 872 updateRenderingContext(); |
871 updateShouldFlattenTransform(); | 873 updateShouldFlattenTransform(); |
872 updateChildrenTransform(); | 874 updateChildrenTransform(); |
| 875 // FIXME: this should not be computed dynamically, but passed down during th
e compositing update. |
| 876 // See http://crbug.com/351851 |
| 877 updateScrollParent(m_owningLayer.scrollParent()); |
873 registerScrollingLayers(); | 878 registerScrollingLayers(); |
874 | 879 |
875 updateCompositingReasons(); | 880 updateCompositingReasons(); |
876 | 881 |
877 return updateType; | 882 return updateType; |
878 } | 883 } |
879 | 884 |
880 void CompositedLayerMapping::registerScrollingLayers() | 885 void CompositedLayerMapping::registerScrollingLayers() |
881 { | 886 { |
882 // Register fixed position layers and their containers with the scrolling co
ordinator. | 887 // 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... |
1389 | 1394 |
1390 // Only the topmost layer has a scroll parent. All other layers have a null
scroll parent. | 1395 // Only the topmost layer has a scroll parent. All other layers have a null
scroll parent. |
1391 if (layer != topmostLayer) | 1396 if (layer != topmostLayer) |
1392 scrollParent = 0; | 1397 scrollParent = 0; |
1393 | 1398 |
1394 scrollingCoordinator->updateScrollParentForGraphicsLayer(layer, scrollParent
); | 1399 scrollingCoordinator->updateScrollParentForGraphicsLayer(layer, scrollParent
); |
1395 } | 1400 } |
1396 | 1401 |
1397 void CompositedLayerMapping::updateScrollParent(RenderLayer* scrollParent) | 1402 void CompositedLayerMapping::updateScrollParent(RenderLayer* scrollParent) |
1398 { | 1403 { |
| 1404 if (!scrollParent && m_squashedLayers.size()) |
| 1405 scrollParent = m_squashedLayers[0].renderLayer->scrollParent(); |
1399 | 1406 |
1400 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay
er(m_owningLayer)) { | 1407 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay
er(m_owningLayer)) { |
1401 GraphicsLayer* topmostLayer = localRootForOwningLayer(); | 1408 GraphicsLayer* topmostLayer = childForSuperlayers(); |
| 1409 updateScrollParentForGraphicsLayer(m_squashingContainmentLayer.get(), to
pmostLayer, scrollParent, scrollingCoordinator); |
1402 updateScrollParentForGraphicsLayer(m_ancestorClippingLayer.get(), topmos
tLayer, scrollParent, scrollingCoordinator); | 1410 updateScrollParentForGraphicsLayer(m_ancestorClippingLayer.get(), topmos
tLayer, scrollParent, scrollingCoordinator); |
1403 updateScrollParentForGraphicsLayer(m_graphicsLayer.get(), topmostLayer,
scrollParent, scrollingCoordinator); | 1411 updateScrollParentForGraphicsLayer(m_graphicsLayer.get(), topmostLayer,
scrollParent, scrollingCoordinator); |
1404 } | 1412 } |
1405 } | 1413 } |
1406 | 1414 |
1407 void CompositedLayerMapping::updateClipParent(RenderLayer* clipParent) | 1415 void CompositedLayerMapping::updateClipParent(RenderLayer* clipParent) |
1408 { | 1416 { |
1409 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay
er(m_owningLayer)) | 1417 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay
er(m_owningLayer)) |
1410 scrollingCoordinator->updateClipParentForGraphicsLayer(m_graphicsLayer.g
et(), clipParent); | 1418 scrollingCoordinator->updateClipParentForGraphicsLayer(m_graphicsLayer.g
et(), clipParent); |
1411 } | 1419 } |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2125 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2133 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
2126 name = "Scrolling Contents Layer"; | 2134 name = "Scrolling Contents Layer"; |
2127 } else { | 2135 } else { |
2128 ASSERT_NOT_REACHED(); | 2136 ASSERT_NOT_REACHED(); |
2129 } | 2137 } |
2130 | 2138 |
2131 return name; | 2139 return name; |
2132 } | 2140 } |
2133 | 2141 |
2134 } // namespace WebCore | 2142 } // namespace WebCore |
OLD | NEW |