Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: Source/core/rendering/compositing/CompositedLayerMapping.cpp

Issue 131543013: Update scroll parent correctly for squashing layers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Now with working LayoutTests (thanks to hartmanng for help with the repaint workaround). Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 863
864 updateHasGpuRasterizationHint(renderer()->style()); 864 updateHasGpuRasterizationHint(renderer()->style());
865 updateContentsRect(); 865 updateContentsRect();
866 updateBackgroundColor(); 866 updateBackgroundColor();
867 updateDrawsContent(); 867 updateDrawsContent();
868 updateContentsOpaque(); 868 updateContentsOpaque();
869 updateAfterWidgetResize(); 869 updateAfterWidgetResize();
870 updateRenderingContext(); 870 updateRenderingContext();
871 updateShouldFlattenTransform(); 871 updateShouldFlattenTransform();
872 updateChildrenTransform(); 872 updateChildrenTransform();
873 updateScrollParent(m_owningLayer.scrollParent());
abarth-chromium 2014/03/12 18:45:40 This function walks up the RenderLayer tree. Inst
Ian Vollick 2014/03/12 20:03:32 Agreed, though it's a little tricky since a layer'
873 registerScrollingLayers(); 874 registerScrollingLayers();
874 875
875 updateCompositingReasons(); 876 updateCompositingReasons();
876 877
877 return updateType; 878 return updateType;
878 } 879 }
879 880
880 void CompositedLayerMapping::registerScrollingLayers() 881 void CompositedLayerMapping::registerScrollingLayers()
881 { 882 {
882 // Register fixed position layers and their containers with the scrolling co ordinator. 883 // Register fixed position layers and their containers with the scrolling co ordinator.
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 1390
1390 // Only the topmost layer has a scroll parent. All other layers have a null scroll parent. 1391 // Only the topmost layer has a scroll parent. All other layers have a null scroll parent.
1391 if (layer != topmostLayer) 1392 if (layer != topmostLayer)
1392 scrollParent = 0; 1393 scrollParent = 0;
1393 1394
1394 scrollingCoordinator->updateScrollParentForGraphicsLayer(layer, scrollParent ); 1395 scrollingCoordinator->updateScrollParentForGraphicsLayer(layer, scrollParent );
1395 } 1396 }
1396 1397
1397 void CompositedLayerMapping::updateScrollParent(RenderLayer* scrollParent) 1398 void CompositedLayerMapping::updateScrollParent(RenderLayer* scrollParent)
1398 { 1399 {
1400 if (!scrollParent && m_squashedLayers.size())
1401 scrollParent = m_squashedLayers[0].renderLayer->scrollParent();
1399 1402
1400 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) { 1403 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) {
1401 GraphicsLayer* topmostLayer = localRootForOwningLayer(); 1404 GraphicsLayer* topmostLayer = childForSuperlayers();
1405 updateScrollParentForGraphicsLayer(m_squashingContainmentLayer.get(), to pmostLayer, scrollParent, scrollingCoordinator);
1402 updateScrollParentForGraphicsLayer(m_ancestorClippingLayer.get(), topmos tLayer, scrollParent, scrollingCoordinator); 1406 updateScrollParentForGraphicsLayer(m_ancestorClippingLayer.get(), topmos tLayer, scrollParent, scrollingCoordinator);
1403 updateScrollParentForGraphicsLayer(m_graphicsLayer.get(), topmostLayer, scrollParent, scrollingCoordinator); 1407 updateScrollParentForGraphicsLayer(m_graphicsLayer.get(), topmostLayer, scrollParent, scrollingCoordinator);
1404 } 1408 }
1405 } 1409 }
1406 1410
1407 void CompositedLayerMapping::updateClipParent(RenderLayer* clipParent) 1411 void CompositedLayerMapping::updateClipParent(RenderLayer* clipParent)
1408 { 1412 {
1409 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) 1413 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer))
1410 scrollingCoordinator->updateClipParentForGraphicsLayer(m_graphicsLayer.g et(), clipParent); 1414 scrollingCoordinator->updateClipParentForGraphicsLayer(m_graphicsLayer.g et(), clipParent);
1411 } 1415 }
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
2125 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2129 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2126 name = "Scrolling Contents Layer"; 2130 name = "Scrolling Contents Layer";
2127 } else { 2131 } else {
2128 ASSERT_NOT_REACHED(); 2132 ASSERT_NOT_REACHED();
2129 } 2133 }
2130 2134
2131 return name; 2135 return name;
2132 } 2136 }
2133 2137
2134 } // namespace WebCore 2138 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698