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

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

Issue 24921002: Make compositingState explicit (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed first round of reviewer comments Created 7 years, 2 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 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 5df38d44cb0b49ccb0765c54baab7613979707fd..a214e26622c85ddd9a548f5fa5edc00ec9f6b13c 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -158,7 +158,7 @@ static void clearPositionConstraintExceptForLayer(GraphicsLayer* layer, Graphics
static WebLayerPositionConstraint computePositionConstraint(const RenderLayer* layer)
{
- ASSERT(layer->isComposited());
+ ASSERT(layer->backing());
do {
if (layer->renderer()->style()->position() == FixedPosition) {
const RenderObject* fixedPositionObject = layer->renderer();
@@ -168,7 +168,9 @@ static WebLayerPositionConstraint computePositionConstraint(const RenderLayer* l
}
layer = layer->parent();
- } while (layer && !layer->isComposited());
+
+ // This walk ends once we found the first layer that has its own backing.
+ } while (layer && (layer->compositingState() == PaintsIntoOwnBacking || layer->compositingState() == HasOwnBackingButPaintsIntoAncestor));
Julien - ping for review 2013/10/03 20:08:36 Couldn't we use backing() here instead to be consi
shawnsingh 2013/10/07 11:45:04 Actually yes, I am reverting this back to using ba
return WebLayerPositionConstraint();
}
@@ -805,12 +807,12 @@ bool ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects(Frame
return true;
RenderLayer* layer = toRenderBoxModelObject(viewportConstrainedObject)->layer();
// Any explicit reason that a fixed position element is not composited shouldn't cause slow scrolling.
- if (!layer->isComposited() && layer->viewportConstrainedNotCompositedReason() == RenderLayer::NoNotCompositedReason)
+ if (layer->compositingState() != PaintsIntoOwnBacking && layer->viewportConstrainedNotCompositedReason() == RenderLayer::NoNotCompositedReason)
return true;
// Composited layers that actually paint into their enclosing ancestor
// must also force main thread scrolling.
- if (layer->isComposited() && layer->backing()->paintsIntoCompositedAncestor())
+ if (layer->compositingState() == HasOwnBackingButPaintsIntoAncestor)
return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698