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

Unified Diff: Source/core/rendering/RenderLayerCompositor.cpp

Issue 14741004: NOT FOR REVIEW - Update comp-scrolling state at a well defined point in the pipeline. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added annotations describing how this patch will be split. Created 7 years, 8 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/rendering/RenderLayerCompositor.cpp
diff --git a/Source/core/rendering/RenderLayerCompositor.cpp b/Source/core/rendering/RenderLayerCompositor.cpp
index ad4ee6295990a1ac396be59b0bf122eec013d79c..68948048fa16b19190f95d2683f835836cab75e2 100644
--- a/Source/core/rendering/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/RenderLayerCompositor.cpp
@@ -218,6 +218,8 @@ RenderLayerCompositor::RenderLayerCompositor(RenderView* renderView)
, m_compositingLayersNeedRebuild(false)
, m_forceCompositingMode(false)
, m_inPostLayoutUpdate(false)
+ // PATCH 2
+ , m_needsUpdateCompositingRequirementsState(false)
, m_isTrackingRepaints(false)
, m_rootLayerAttachment(RootLayerUnattached)
#if !LOG_DISABLED
@@ -330,6 +332,46 @@ bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer*
return m_compositedLayerCount > (rootLayer->isComposited() ? 1 : 0);
}
+// PATCH 2
+void RenderLayerCompositor::updateCompositingRequirementsState(CompositingUpdateType updateType, RenderLayer* updateRoot)
+{
+ if (!m_needsUpdateCompositingRequirementsState)
+ return;
+
+ const bool firstIteration = !updateRoot;
+ if (!updateRoot) {
+ bool needsUpdateHasOutOfFlowPositionedDescendant = false;
+ switch (updateType) {
+ case CompositingUpdateAfterStyleChange:
+ needsUpdateHasOutOfFlowPositionedDescendant = true;
+ break;
+ case CompositingUpdateAfterLayout:
+ break;
+ case CompositingUpdateOnScroll:
+ case CompositingUpdateOnCompositedScroll:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+
+ updateRoot = rootRenderLayer();
+ updateRoot->updateDescendantDependentFlags();
+ if (needsUpdateHasOutOfFlowPositionedDescendant) {
+ updateRoot->updateHasOutOfFlowPositionedDescendant();
+ }
+ }
+
+ updateRoot->updateNeedsCompositedScrolling();
+
+ // In this function we update state that determines whether layers are
+ // stacking containers. We may therefore not use this concept here. Instead,
+ // we'll iterate through the tree topologically.
+ for (RenderLayer* child = updateRoot->firstChild(); child; child = child->nextSibling())
+ updateCompositingRequirementsState(updateType, child);
+
+ if (firstIteration)
+ m_needsUpdateCompositingRequirementsState = false;
+}
+
void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType updateType, RenderLayer* updateRoot)
{
// Avoid updating the layers with old values. Compositing layers will be updated after the layout is finished.

Powered by Google App Engine
This is Rietveld 408576698