Index: Source/core/rendering/RenderLayerScrollableArea.cpp |
diff --git a/Source/core/rendering/RenderLayerScrollableArea.cpp b/Source/core/rendering/RenderLayerScrollableArea.cpp |
index d61144d26f7814ff6db932f4099e431361ea5cfc..e3fab35c0717eebbe301ce0c9ab244d9bd591b28 100644 |
--- a/Source/core/rendering/RenderLayerScrollableArea.cpp |
+++ b/Source/core/rendering/RenderLayerScrollableArea.cpp |
@@ -153,7 +153,8 @@ HostWindow* RenderLayerScrollableArea::hostWindow() const |
GraphicsLayer* RenderLayerScrollableArea::layerForScrolling() const |
{ |
- return layer()->hasCompositedLayerMapping() ? layer()->compositedLayerMapping()->scrollingContentsLayer() : 0; |
+ CompositedLayerMapping* compositedLayerMapping = layer()->compositedLayerMapping(); |
+ return compositedLayerMapping ? compositedLayerMapping->scrollingContentsLayer() : 0; |
} |
GraphicsLayer* RenderLayerScrollableArea::layerForHorizontalScrollbar() const |
@@ -161,7 +162,8 @@ GraphicsLayer* RenderLayerScrollableArea::layerForHorizontalScrollbar() const |
// See crbug.com/343132. |
DisableCompositingQueryAsserts disabler; |
- return layer()->hasCompositedLayerMapping() ? layer()->compositedLayerMapping()->layerForHorizontalScrollbar() : 0; |
+ CompositedLayerMapping* compositedLayerMapping = layer()->compositedLayerMapping(); |
+ return compositedLayerMapping ? compositedLayerMapping->layerForHorizontalScrollbar() : 0; |
} |
GraphicsLayer* RenderLayerScrollableArea::layerForVerticalScrollbar() const |
@@ -169,7 +171,8 @@ GraphicsLayer* RenderLayerScrollableArea::layerForVerticalScrollbar() const |
// See crbug.com/343132. |
DisableCompositingQueryAsserts disabler; |
- return layer()->hasCompositedLayerMapping() ? layer()->compositedLayerMapping()->layerForVerticalScrollbar() : 0; |
+ CompositedLayerMapping* compositedLayerMapping = layer()->compositedLayerMapping(); |
+ return compositedLayerMapping ? compositedLayerMapping->layerForVerticalScrollbar() : 0; |
} |
GraphicsLayer* RenderLayerScrollableArea::layerForScrollCorner() const |
@@ -177,7 +180,8 @@ GraphicsLayer* RenderLayerScrollableArea::layerForScrollCorner() const |
// See crbug.com/343132. |
DisableCompositingQueryAsserts disabler; |
- return layer()->hasCompositedLayerMapping() ? layer()->compositedLayerMapping()->layerForScrollCorner() : 0; |
+ CompositedLayerMapping* compositedLayerMapping = layer()->compositedLayerMapping(); |
+ return compositedLayerMapping ? compositedLayerMapping->layerForScrollCorner() : 0; |
} |
void RenderLayerScrollableArea::invalidateScrollbarRect(Scrollbar* scrollbar, const IntRect& rect) |
@@ -993,8 +997,8 @@ void RenderLayerScrollableArea::positionOverflowControls(const IntSize& offsetFr |
// FIXME, this should eventually be removed, once we are certain that composited |
// controls get correctly positioned on a compositor update. For now, conservatively |
// leaving this unchanged. |
- if (layer()->hasCompositedLayerMapping()) |
- layer()->compositedLayerMapping()->positionOverflowControlsLayers(offsetFromRoot); |
+ if (CompositedLayerMapping* compositedLayerMapping = layer()->compositedLayerMapping()) |
+ compositedLayerMapping->positionOverflowControlsLayers(offsetFromRoot); |
} |
void RenderLayerScrollableArea::updateScrollCornerStyle() |
@@ -1447,8 +1451,9 @@ void RenderLayerScrollableArea::updateCompositingLayersAfterScroll() |
if (compositor->inCompositingMode()) { |
if (usesCompositedScrolling()) { |
DisableCompositingQueryAsserts disabler; |
- ASSERT(layer()->hasCompositedLayerMapping()); |
- layer()->compositedLayerMapping()->setNeedsGraphicsLayerUpdate(GraphicsLayerUpdateSubtree); |
+ CompositedLayerMapping* compositedLayerMapping = layer()->compositedLayerMapping(); |
+ ASSERT(compositedLayerMapping); |
+ compositedLayerMapping->setNeedsGraphicsLayerUpdate(GraphicsLayerUpdateSubtree); |
compositor->setNeedsCompositingUpdate(CompositingUpdateAfterGeometryChange); |
} else { |
layer()->setNeedsCompositingInputsUpdate(); |
@@ -1464,7 +1469,9 @@ bool RenderLayerScrollableArea::usesCompositedScrolling() const |
// See https://codereview.chromium.org/176633003/ for the tests that fail without this disabler. |
DisableCompositingQueryAsserts disabler; |
- return layer()->hasCompositedLayerMapping() && layer()->compositedLayerMapping()->scrollingLayer(); |
+ |
+ CompositedLayerMapping* compositedLayerMapping = layer()->compositedLayerMapping(); |
+ return compositedLayerMapping && compositedLayerMapping->scrollingLayer(); |
} |
static bool layerNeedsCompositedScrolling(const RenderLayer* layer) |