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

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

Issue 58543002: Use a boolean hasCompositedLayerMapping() accessor instead of the pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased 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..60f66e39bdbba63b7496fa358fdcaf575b4e5237 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -172,7 +172,7 @@ static void clearPositionConstraintExceptForLayer(GraphicsLayer* layer, Graphics
static WebLayerPositionConstraint computePositionConstraint(const RenderLayer* layer)
{
- ASSERT(layer->compositedLayerMapping());
+ ASSERT(layer->hasCompositedLayerMapping());
do {
if (layer->renderer()->style()->position() == FixedPosition) {
const RenderObject* fixedPositionObject = layer->renderer();
@@ -185,13 +185,13 @@ 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->hasCompositedLayerMapping());
return WebLayerPositionConstraint();
}
void ScrollingCoordinator::updateLayerPositionConstraint(RenderLayer* layer)
{
- ASSERT(layer->compositedLayerMapping());
+ ASSERT(layer->hasCompositedLayerMapping());
CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMapping();
GraphicsLayer* mainLayer = compositedLayerMapping->childForSuperlayers();
@@ -523,7 +523,8 @@ 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()) {
+ if ((*it)->hasCompositedLayerMapping()) {
+ CompositedLayerMapping* compositedLayerMapping = (*it)->compositedLayerMapping();
GraphicsLayer* graphicsLayer = compositedLayerMapping->scrollingContentsLayer();
if (!graphicsLayer)
graphicsLayer = compositedLayerMapping->mainGraphicsLayer();
@@ -553,7 +554,7 @@ void ScrollingCoordinator::touchEventTargetRectsDidChange(const Document*)
void ScrollingCoordinator::updateScrollParentForGraphicsLayer(GraphicsLayer* child, RenderLayer* parent)
{
WebLayer* scrollParentWebLayer = 0;
- if (parent && parent->compositedLayerMapping())
+ if (parent && parent->hasCompositedLayerMapping())
scrollParentWebLayer = scrollingWebLayerForGraphicsLayer(parent->compositedLayerMapping()->parentForSublayers());
child->setScrollParent(scrollParentWebLayer);
@@ -562,7 +563,7 @@ void ScrollingCoordinator::updateScrollParentForGraphicsLayer(GraphicsLayer* chi
void ScrollingCoordinator::updateClipParentForGraphicsLayer(GraphicsLayer* child, RenderLayer* parent)
{
WebLayer* clipParentWebLayer = 0;
- if (parent && parent->compositedLayerMapping())
+ if (parent && parent->hasCompositedLayerMapping())
clipParentWebLayer = scrollingWebLayerForGraphicsLayer(parent->compositedLayerMapping()->parentForSublayers());
child->setClipParent(clipParentWebLayer);

Powered by Google App Engine
This is Rietveld 408576698