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

Unified Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 59063003: Don't coerce pointers to compositor layer mappings to booleans. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaaaase Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/page/scrolling/ScrollingCoordinator.cpp
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp
index ca72786a164baa198caa2f41b0cb17abaa85f6d6..c1e947f959cef881912dbe0c08c1dcded1958ec2 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -185,14 +185,14 @@ static WebLayerPositionConstraint computePositionConstraint(const RenderLayer* l
// Composited layers that inherit a fixed position state will be positioned with respect to the nearest compositedLayerMapping's GraphicsLayer.
// So, once we find a layer that has its own compositedLayerMapping, we can stop searching for a fixed position RenderObject.
- } while (layer && layer->compositedLayerMapping());
+ } while (layer && layer->compositingState() == PaintsIntoOwnBacking);
shawnsingh 2013/11/05 10:20:27 This is not correct - see the comment immediately
Ian Vollick 2013/11/08 03:35:12 I think the comment (and possibly the code) are wr
return WebLayerPositionConstraint();
}
void ScrollingCoordinator::updateLayerPositionConstraint(RenderLayer* layer)
{
ASSERT(layer->compositedLayerMapping());
- CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMapping();
+ CompositedLayerMappingPtr compositedLayerMapping = layer->compositedLayerMapping();
GraphicsLayer* mainLayer = compositedLayerMapping->childForSuperlayers();
// Avoid unnecessary commits
@@ -510,7 +510,7 @@ void ScrollingCoordinator::setTouchEventTargetRects(const LayerHitTestRects& lay
WebVector<WebRect> webRects(iter->value.size());
for (size_t i = 0; i < iter->value.size(); ++i)
webRects[i] = enclosingIntRect(iter->value[i]);
- CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMapping();
+ CompositedLayerMappingPtr compositedLayerMapping = layer->compositedLayerMapping();
// If the layer is using composited scrolling, then it's the contents that these
// rects apply to.
GraphicsLayer* graphicsLayer = compositedLayerMapping->scrollingContentsLayer();
@@ -523,10 +523,10 @@ void ScrollingCoordinator::setTouchEventTargetRects(const LayerHitTestRects& lay
// If there are any layers left that we haven't updated, clear them out.
for (HashSet<const RenderLayer*>::iterator it = oldLayersWithTouchRects.begin(); it != oldLayersWithTouchRects.end(); ++it) {
- if (CompositedLayerMapping* compositedLayerMapping = (*it)->compositedLayerMapping()) {
- GraphicsLayer* graphicsLayer = compositedLayerMapping->scrollingContentsLayer();
+ if ((*it)->compositingState() == PaintsIntoOwnBacking) {
shawnsingh 2013/11/05 10:20:27 I think this also needs to include HasOwnBackingBu
Ian Vollick 2013/11/08 03:35:12 I think this is a bug, but I'm not going to fix it
+ GraphicsLayer* graphicsLayer = (*it)->compositedLayerMapping()->scrollingContentsLayer();
if (!graphicsLayer)
- graphicsLayer = compositedLayerMapping->mainGraphicsLayer();
+ graphicsLayer = (*it)->compositedLayerMapping()->mainGraphicsLayer();
graphicsLayer->platformLayer()->setTouchEventHandlerRegion(WebVector<WebRect>());
}
}
@@ -553,7 +553,7 @@ void ScrollingCoordinator::touchEventTargetRectsDidChange(const Document*)
void ScrollingCoordinator::updateScrollParentForGraphicsLayer(GraphicsLayer* child, RenderLayer* parent)
{
WebLayer* scrollParentWebLayer = 0;
- if (parent && parent->compositedLayerMapping())
+ if (parent && parent->compositingState() == PaintsIntoOwnBacking)
scrollParentWebLayer = scrollingWebLayerForGraphicsLayer(parent->compositedLayerMapping()->parentForSublayers());
child->setScrollParent(scrollParentWebLayer);
@@ -562,7 +562,7 @@ void ScrollingCoordinator::updateScrollParentForGraphicsLayer(GraphicsLayer* chi
void ScrollingCoordinator::updateClipParentForGraphicsLayer(GraphicsLayer* child, RenderLayer* parent)
{
WebLayer* clipParentWebLayer = 0;
- if (parent && parent->compositedLayerMapping())
+ if (parent && parent->compositingState() == PaintsIntoOwnBacking)
clipParentWebLayer = scrollingWebLayerForGraphicsLayer(parent->compositedLayerMapping()->parentForSublayers());
child->setClipParent(clipParentWebLayer);

Powered by Google App Engine
This is Rietveld 408576698