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

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

Issue 320103005: Delete RenderLayerCompositor::m_compositingLayersNeedRebuild (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: less wrong code Created 6 years, 6 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 0f7d4a139e5e4c7a6cbbc35def7ed1cdf3e438b7..53b596cecb3bc141a91a32e7f847854ec0f835a8 100644
--- a/Source/core/rendering/compositing/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/compositing/RenderLayerCompositor.cpp
@@ -89,7 +89,6 @@ RenderLayerCompositor::RenderLayerCompositor(RenderView& renderView)
, m_pendingUpdateType(CompositingUpdateNone)
, m_hasAcceleratedCompositing(true)
, m_compositing(false)
- , m_compositingLayersNeedRebuild(false)
, m_rootShouldAlwaysCompositeDirty(true)
, m_needsUpdateFixedBackground(false)
, m_isTrackingRepaints(false)
@@ -153,18 +152,11 @@ void RenderLayerCompositor::enableCompositingModeIfNeeded()
if (rootShouldAlwaysComposite()) {
// FIXME: Is this needed? It was added in https://bugs.webkit.org/show_bug.cgi?id=26651.
// No tests fail if it's deleted.
- setCompositingLayersNeedRebuild();
+ setNeedsCompositingUpdate(CompositingUpdateRebuildTree);
setCompositingModeEnabled(true);
}
}
-bool RenderLayerCompositor::compositingLayersNeedRebuild()
-{
- // enableCompositingModeIfNeeded can set the m_compositingLayersNeedRebuild bit.
- ASSERT(!m_rootShouldAlwaysCompositeDirty);
- return m_compositingLayersNeedRebuild;
-}
-
bool RenderLayerCompositor::rootShouldAlwaysComposite() const
{
if (!m_hasAcceleratedCompositing)
@@ -175,15 +167,7 @@ bool RenderLayerCompositor::rootShouldAlwaysComposite() const
void RenderLayerCompositor::updateAcceleratedCompositingSettings()
{
m_compositingReasonFinder.updateTriggers();
-
- bool hasAcceleratedCompositing = m_renderView.document().settings()->acceleratedCompositingEnabled();
-
- // FIXME: Is this needed? It was added in https://bugs.webkit.org/show_bug.cgi?id=26651.
- // No tests fail if it's deleted.
- if (hasAcceleratedCompositing != m_hasAcceleratedCompositing)
- setCompositingLayersNeedRebuild();
-
- m_hasAcceleratedCompositing = hasAcceleratedCompositing;
+ m_hasAcceleratedCompositing = m_renderView.document().settings()->acceleratedCompositingEnabled();
m_rootShouldAlwaysCompositeDirty = true;
}
@@ -201,14 +185,6 @@ bool RenderLayerCompositor::acceleratedCompositingForOverflowScrollEnabled() con
return m_compositingReasonFinder.hasOverflowScrollTrigger();
}
-void RenderLayerCompositor::setCompositingLayersNeedRebuild()
-{
- // FIXME: crbug.com/332248 ideally this could be merged with setNeedsCompositingUpdate().
- m_compositingLayersNeedRebuild = true;
- page()->animator().scheduleVisualUpdate();
- lifecycle().ensureStateAtMost(DocumentLifecycle::LayoutClean);
-}
-
static RenderVideo* findFullscreenVideoRenderer(Document& document)
{
Element* fullscreenElement = FullscreenElementStack::fullscreenElementFrom(document);
@@ -292,7 +268,6 @@ void RenderLayerCompositor::didLayout()
void RenderLayerCompositor::assertNoUnresolvedDirtyBits()
{
- ASSERT(!compositingLayersNeedRebuild());
ASSERT(m_pendingUpdateType == CompositingUpdateNone);
ASSERT(!m_rootShouldAlwaysCompositeDirty);
}
@@ -339,27 +314,21 @@ void RenderLayerCompositor::updateIfNeeded()
// before moving this function after checking the dirty bits.
DeprecatedDirtyCompositingDuringCompositingUpdate marker(lifecycle());
- // FIXME: enableCompositingModeIfNeeded can call setCompositingLayersNeedRebuild,
+ // FIXME: enableCompositingModeIfNeeded can trigger a CompositingUpdateRebuildTree,
// which asserts that it's not InCompositingUpdate.
enableCompositingModeIfNeeded();
}
CompositingUpdateType updateType = m_pendingUpdateType;
- bool needHierarchyAndGeometryUpdate = compositingLayersNeedRebuild();
-
m_pendingUpdateType = CompositingUpdateNone;
- m_compositingLayersNeedRebuild = false;
if (!hasAcceleratedCompositing())
return;
bool needsToUpdateScrollingCoordinator = scrollingCoordinator() && scrollingCoordinator()->needsToUpdateAfterCompositingChange();
- if (updateType == CompositingUpdateNone && !needHierarchyAndGeometryUpdate && !needsToUpdateScrollingCoordinator)
+ if (updateType == CompositingUpdateNone && !needsToUpdateScrollingCoordinator)
return;
- GraphicsLayerUpdater::UpdateType graphicsLayerUpdateType = GraphicsLayerUpdater::DoNotForceUpdate;
- CompositingPropertyUpdater::UpdateType compositingPropertyUpdateType = CompositingPropertyUpdater::DoNotForceUpdate;
-
RenderLayer* updateRoot = rootRenderLayer();
Vector<RenderLayer*> layersNeedingRepaint;
@@ -368,7 +337,7 @@ void RenderLayerCompositor::updateIfNeeded()
bool layersChanged = false;
{
TRACE_EVENT0("blink_rendering", "CompositingPropertyUpdater::updateAncestorDependentProperties");
- CompositingPropertyUpdater(updateRoot).updateAncestorDependentProperties(updateRoot, compositingPropertyUpdateType);
+ CompositingPropertyUpdater(updateRoot).updateAncestorDependentProperties(updateRoot);
#if ASSERT_ENABLED
CompositingPropertyUpdater::assertNeedsToUpdateAncestorDependantPropertiesBitsCleared(updateRoot);
#endif
@@ -390,16 +359,16 @@ void RenderLayerCompositor::updateIfNeeded()
}
if (layersChanged)
- needHierarchyAndGeometryUpdate = true;
+ updateType = std::max(updateType, CompositingUpdateRebuildTree);
}
- if (updateType != CompositingUpdateNone || needHierarchyAndGeometryUpdate) {
+ if (updateType != CompositingUpdateNone) {
TRACE_EVENT0("blink_rendering", "GraphicsLayerUpdater::updateRecursive");
GraphicsLayerUpdater updater;
- updater.update(*updateRoot, graphicsLayerUpdateType);
+ updater.update(*updateRoot);
if (updater.needsRebuildTree())
- needHierarchyAndGeometryUpdate = true;
+ updateType = std::max(updateType, CompositingUpdateRebuildTree);
#if !ASSERT_DISABLED
// FIXME: Move this check to the end of the compositing update.
@@ -407,8 +376,7 @@ void RenderLayerCompositor::updateIfNeeded()
#endif
}
- if (needHierarchyAndGeometryUpdate) {
- // Update the hierarchy of the compositing layers.
+ if (updateType >= CompositingUpdateRebuildTree) {
GraphicsLayerVector childList;
{
TRACE_EVENT0("blink_rendering", "GraphicsLayerTreeBuilder::rebuild");
@@ -429,8 +397,6 @@ void RenderLayerCompositor::updateIfNeeded()
m_needsUpdateFixedBackground = false;
}
- ASSERT(updateRoot || !compositingLayersNeedRebuild());
-
// The scrolling coordinator may realize that it needs updating while compositing was being updated in this function.
needsToUpdateScrollingCoordinator |= scrollingCoordinator() && scrollingCoordinator()->needsToUpdateAfterCompositingChange();
if (needsToUpdateScrollingCoordinator && m_renderView.frame()->isMainFrame() && scrollingCoordinator() && inCompositingMode())
@@ -555,7 +521,7 @@ void RenderLayerCompositor::updateLayerCompositingState(RenderLayer* layer, Upda
CompositingStateTransitionType compositedLayerUpdate = CompositingLayerAssigner(this).computeCompositedLayerUpdate(layer);
if (compositedLayerUpdate != NoCompositingStateChange)
- setCompositingLayersNeedRebuild();
+ setNeedsCompositingUpdate(CompositingUpdateRebuildTree);
if (options == UseChickenEggHacks)
applyUpdateLayerCompositingStateChickenEggHacks(layer, compositedLayerUpdate);
@@ -587,7 +553,7 @@ void RenderLayerCompositor::repaintInCompositedAncestor(RenderLayer* layer, cons
void RenderLayerCompositor::layerWasAdded(RenderLayer* /*parent*/, RenderLayer* /*child*/)
{
- setCompositingLayersNeedRebuild();
+ setNeedsCompositingUpdate(CompositingUpdateRebuildTree);
}
void RenderLayerCompositor::layerWillBeRemoved(RenderLayer* parent, RenderLayer* child)
@@ -602,7 +568,7 @@ void RenderLayerCompositor::layerWillBeRemoved(RenderLayer* parent, RenderLayer*
repaintInCompositedAncestor(child, child->compositedLayerMapping()->compositedBounds());
}
- setCompositingLayersNeedRebuild();
+ setNeedsCompositingUpdate(CompositingUpdateRebuildTree);
}
void RenderLayerCompositor::frameViewDidChangeLocation(const IntPoint& contentsOffset)
« 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