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

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

Issue 213833014: Merge two update type fields in RenderLayerCompositor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
« no previous file with comments | « Source/core/rendering/compositing/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/compositing/RenderLayerCompositor.cpp
diff --git a/Source/core/rendering/compositing/RenderLayerCompositor.cpp b/Source/core/rendering/compositing/RenderLayerCompositor.cpp
index 4dc163ee1db39682f9c3fb41cfad7735eaae0f1b..b41ece984abc756ce16428f9ab41d420c82e8ead 100644
--- a/Source/core/rendering/compositing/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/compositing/RenderLayerCompositor.cpp
@@ -198,12 +198,11 @@ struct CompositingRecursionData {
RenderLayerCompositor::RenderLayerCompositor(RenderView& renderView)
: m_renderView(renderView)
, m_compositingReasonFinder(renderView)
+ , m_pendingUpdateType(CompositingUpdateNone)
, m_hasAcceleratedCompositing(true)
, m_showRepaintCounter(false)
, m_needsToRecomputeCompositingRequirements(false)
, m_needsToUpdateLayerTreeGeometry(false)
- , m_pendingUpdateType(GraphicsLayerUpdater::DoNotForceUpdate)
- , m_pendingPropertyUpdateType(CompositingPropertyUpdater::DoNotForceUpdate)
, m_compositing(false)
, m_compositingLayersNeedRebuild(false)
, m_forceCompositingMode(false)
@@ -360,31 +359,24 @@ void RenderLayerCompositor::setNeedsCompositingUpdate(CompositingUpdateType upda
if (!m_needsToRecomputeCompositingRequirements && !m_compositing)
return;
+ m_pendingUpdateType = std::max(m_pendingUpdateType, updateType);
+
switch (updateType) {
+ case CompositingUpdateNone:
+ ASSERT_NOT_REACHED();
esprehn 2014/04/01 00:13:15 Lets put this also at the top of the function as A
+ break;
case CompositingUpdateAfterStyleChange:
m_needsToRecomputeCompositingRequirements = true;
break;
case CompositingUpdateAfterLayout:
m_needsToRecomputeCompositingRequirements = true;
- // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
- m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate;
- // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
- m_pendingPropertyUpdateType = CompositingPropertyUpdater::ForceUpdate;
break;
case CompositingUpdateOnScroll:
m_needsToRecomputeCompositingRequirements = true; // Overlap can change with scrolling, so need to check for hierarchy updates.
m_needsToUpdateLayerTreeGeometry = true;
- // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
- m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate;
- // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
- m_pendingPropertyUpdateType = CompositingPropertyUpdater::ForceUpdate;
break;
case CompositingUpdateOnCompositedScroll:
m_needsToUpdateLayerTreeGeometry = true;
- // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
- m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate;
- // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
- m_pendingPropertyUpdateType = CompositingPropertyUpdater::ForceUpdate;
break;
case CompositingUpdateAfterCanvasContextChange:
m_needsToUpdateLayerTreeGeometry = true;
@@ -444,7 +436,7 @@ void RenderLayerCompositor::scheduleAnimationIfNeeded()
bool RenderLayerCompositor::hasUnresolvedDirtyBits()
{
- return m_needsToRecomputeCompositingRequirements || m_compositingLayersNeedRebuild || m_needsToUpdateLayerTreeGeometry || m_needsUpdateCompositingRequirementsState || m_pendingUpdateType != GraphicsLayerUpdater::DoNotForceUpdate;
+ return m_needsToRecomputeCompositingRequirements || m_compositingLayersNeedRebuild || m_needsToUpdateLayerTreeGeometry || m_needsUpdateCompositingRequirementsState || m_pendingUpdateType > CompositingUpdateNone;
}
void RenderLayerCompositor::updateCompositingLayersInternal()
@@ -458,6 +450,8 @@ void RenderLayerCompositor::updateCompositingLayersInternal()
if (!m_needsToRecomputeCompositingRequirements && !m_compositing)
return;
+ CompositingUpdateType updateType = m_pendingUpdateType;
+
bool needCompositingRequirementsUpdate = m_needsToRecomputeCompositingRequirements;
bool needHierarchyAndGeometryUpdate = m_compositingLayersNeedRebuild;
bool needGeometryUpdate = m_needsToUpdateLayerTreeGeometry;
@@ -466,13 +460,21 @@ void RenderLayerCompositor::updateCompositingLayersInternal()
if (!needCompositingRequirementsUpdate && !needHierarchyAndGeometryUpdate && !needGeometryUpdate && !needsToUpdateScrollingCoordinator)
return;
- GraphicsLayerUpdater::UpdateType updateType = m_pendingUpdateType;
+ m_pendingUpdateType = CompositingUpdateNone;
+
+ GraphicsLayerUpdater::UpdateType graphicsLayerUpdateType = GraphicsLayerUpdater::DoNotForceUpdate;
+ CompositingPropertyUpdater::UpdateType compositingPropertyUpdateType = CompositingPropertyUpdater::DoNotForceUpdate;
+
+ // FIXME: Teach non-style compositing updates how to do partial tree walks.
+ if (updateType >= CompositingUpdateAfterLayout) {
+ graphicsLayerUpdateType = GraphicsLayerUpdater::ForceUpdate;
+ compositingPropertyUpdateType = CompositingPropertyUpdater::ForceUpdate;
+ }
// Only clear the flags if we're updating the entire hierarchy.
m_compositingLayersNeedRebuild = false;
m_needsToUpdateLayerTreeGeometry = false;
m_needsToRecomputeCompositingRequirements = false;
- m_pendingUpdateType = GraphicsLayerUpdater::DoNotForceUpdate;
RenderLayer* updateRoot = rootRenderLayer();
@@ -485,8 +487,7 @@ void RenderLayerCompositor::updateCompositingLayersInternal()
{
TRACE_EVENT0("blink_rendering", "CompositingPropertyUpdater::updateAncestorDependentProperties");
- CompositingPropertyUpdater(updateRoot).updateAncestorDependentProperties(updateRoot, m_pendingPropertyUpdateType, 0);
- m_pendingPropertyUpdateType = CompositingPropertyUpdater::DoNotForceUpdate;
+ CompositingPropertyUpdater(updateRoot).updateAncestorDependentProperties(updateRoot, compositingPropertyUpdateType, 0);
#if !ASSERT_DISABLED
CompositingPropertyUpdater::assertNeedsToUpdateAncestorDependantPropertiesBitsCleared(updateRoot);
#endif
@@ -525,7 +526,7 @@ void RenderLayerCompositor::updateCompositingLayersInternal()
if (needGeometryUpdate || needHierarchyAndGeometryUpdate) {
TRACE_EVENT0("blink_rendering", "GraphicsLayerUpdater::updateRecursive");
- GraphicsLayerUpdater().update(*updateRoot, updateType);
+ GraphicsLayerUpdater().update(*updateRoot, graphicsLayerUpdateType);
#if !ASSERT_DISABLED
// FIXME: Move this check to the end of the compositing update.
GraphicsLayerUpdater::assertNeedsToUpdateGraphicsLayerBitsCleared(*updateRoot);
« no previous file with comments | « Source/core/rendering/compositing/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698