Commit b6352e1f authored by abarth@chromium.org's avatar abarth@chromium.org

Delete CompositingUpdateAfterLayout

Rather than using a different update type, we can just mark the root as needing
its properties updated, which will cause us to update the entire tree. This CL
alone isn't a huge win, but it will let us remove
RenderLayerCompositor::m_compositingLayersNeedRebuild in the next CL.

Also, move the call to enableCompositingModeIfNeeded into the new
RenderLayerCompositor::didLayout function. This makes the sequence look a bit
silly (because we mark the dirty bit only to clear it immediately), but that's
what the code did before (albeit in a more roundabout way).

BUG=332248

Review URL: https://codereview.chromium.org/323653002

git-svn-id: svn://svn.chromium.org/blink/trunk@175738 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 51ad6897
...@@ -970,7 +970,7 @@ void FrameView::layout(bool allowSubtree) ...@@ -970,7 +970,7 @@ void FrameView::layout(bool allowSubtree)
adjustViewSize(); adjustViewSize();
layer->updateLayerPositionsAfterLayout(renderView()->layer(), updateLayerPositionFlags(layer, inSubtreeLayout, m_doFullPaintInvalidation)); layer->updateLayerPositionsAfterLayout(renderView()->layer(), updateLayerPositionFlags(layer, inSubtreeLayout, m_doFullPaintInvalidation));
renderView()->compositor()->setNeedsCompositingUpdate(CompositingUpdateAfterLayout); renderView()->compositor()->didLayout();
m_layoutCount++; m_layoutCount++;
......
...@@ -257,25 +257,25 @@ void RenderLayerCompositor::updateIfNeededRecursive() ...@@ -257,25 +257,25 @@ void RenderLayerCompositor::updateIfNeededRecursive()
void RenderLayerCompositor::setNeedsCompositingUpdate(CompositingUpdateType updateType) void RenderLayerCompositor::setNeedsCompositingUpdate(CompositingUpdateType updateType)
{ {
ASSERT(updateType != CompositingUpdateNone); ASSERT(updateType != CompositingUpdateNone);
// FIXME: Technically we only need to do this when the FrameView's isScrollable method
// would return a different value.
if (updateType == CompositingUpdateAfterLayout)
m_rootShouldAlwaysCompositeDirty = true;
// FIXME: This function should only set dirty bits. We shouldn't
// enable compositing mode here.
// We check needsLayout here because we don't know if we need to enable
// compositing mode until layout is up-to-date because we need to know
// if this frame scrolls.
if (!m_renderView.needsLayout())
enableCompositingModeIfNeeded();
m_pendingUpdateType = std::max(m_pendingUpdateType, updateType); m_pendingUpdateType = std::max(m_pendingUpdateType, updateType);
page()->animator().scheduleVisualUpdate(); page()->animator().scheduleVisualUpdate();
lifecycle().ensureStateAtMost(DocumentLifecycle::LayoutClean); lifecycle().ensureStateAtMost(DocumentLifecycle::LayoutClean);
} }
void RenderLayerCompositor::didLayout()
{
// FIXME: Technically we only need to do this when the FrameView's
// isScrollable method would return a different value.
m_rootShouldAlwaysCompositeDirty = true;
enableCompositingModeIfNeeded();
// FIXME: Rather than marking the entire RenderView as dirty, we should
// track which RenderLayers moved during layout and only dirty those
// specific RenderLayers.
rootRenderLayer()->setNeedsToUpdateAncestorDependentProperties();
setNeedsCompositingUpdate(CompositingUpdateAfterCompositingInputChange);
}
#if ASSERT_ENABLED #if ASSERT_ENABLED
void RenderLayerCompositor::assertNoUnresolvedDirtyBits() void RenderLayerCompositor::assertNoUnresolvedDirtyBits()
...@@ -348,12 +348,6 @@ void RenderLayerCompositor::updateIfNeeded() ...@@ -348,12 +348,6 @@ void RenderLayerCompositor::updateIfNeeded()
GraphicsLayerUpdater::UpdateType graphicsLayerUpdateType = GraphicsLayerUpdater::DoNotForceUpdate; GraphicsLayerUpdater::UpdateType graphicsLayerUpdateType = GraphicsLayerUpdater::DoNotForceUpdate;
CompositingPropertyUpdater::UpdateType compositingPropertyUpdateType = CompositingPropertyUpdater::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;
}
RenderLayer* updateRoot = rootRenderLayer(); RenderLayer* updateRoot = rootRenderLayer();
Vector<RenderLayer*> layersNeedingRepaint; Vector<RenderLayer*> layersNeedingRepaint;
......
...@@ -49,7 +49,6 @@ enum CompositingUpdateType { ...@@ -49,7 +49,6 @@ enum CompositingUpdateType {
CompositingUpdateNone, CompositingUpdateNone,
CompositingUpdateOnCompositedScroll, CompositingUpdateOnCompositedScroll,
CompositingUpdateAfterCompositingInputChange, CompositingUpdateAfterCompositingInputChange,
CompositingUpdateAfterLayout,
}; };
enum CompositingStateTransitionType { enum CompositingStateTransitionType {
...@@ -102,6 +101,8 @@ public: ...@@ -102,6 +101,8 @@ public:
// Used to indicate that a compositing update will be needed for the next frame that gets drawn. // Used to indicate that a compositing update will be needed for the next frame that gets drawn.
void setNeedsCompositingUpdate(CompositingUpdateType); void setNeedsCompositingUpdate(CompositingUpdateType);
void didLayout();
enum UpdateLayerCompositingStateOptions { enum UpdateLayerCompositingStateOptions {
Normal, Normal,
UseChickenEggHacks, // Use this to trigger temporary chicken-egg hacks. See crbug.com/339892. UseChickenEggHacks, // Use this to trigger temporary chicken-egg hacks. See crbug.com/339892.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment