Commit d25c7475 authored by dcheng@chromium.org's avatar dcheng@chromium.org

Revert of Delete CompositingUpdateAfterLayout (https://codereview.chromium.org/323653002/)

Reason for revert:
Triggers ASSERT when running browser_test CastStreamingApiTestWithPixelOutput.RtpStreamError

Original issue's description:
> 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
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175738

TBR=esprehn@chromium.org,abarth@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=332248

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175742 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e8540dc8
......@@ -970,7 +970,7 @@ void FrameView::layout(bool allowSubtree)
adjustViewSize();
layer->updateLayerPositionsAfterLayout(renderView()->layer(), updateLayerPositionFlags(layer, inSubtreeLayout, m_doFullPaintInvalidation));
renderView()->compositor()->didLayout();
renderView()->compositor()->setNeedsCompositingUpdate(CompositingUpdateAfterLayout);
m_layoutCount++;
......
......@@ -257,25 +257,25 @@ void RenderLayerCompositor::updateIfNeededRecursive()
void RenderLayerCompositor::setNeedsCompositingUpdate(CompositingUpdateType updateType)
{
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);
page()->animator().scheduleVisualUpdate();
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
void RenderLayerCompositor::assertNoUnresolvedDirtyBits()
......@@ -348,6 +348,12 @@ void RenderLayerCompositor::updateIfNeeded()
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;
}
RenderLayer* updateRoot = rootRenderLayer();
Vector<RenderLayer*> layersNeedingRepaint;
......
......@@ -49,6 +49,7 @@ enum CompositingUpdateType {
CompositingUpdateNone,
CompositingUpdateOnCompositedScroll,
CompositingUpdateAfterCompositingInputChange,
CompositingUpdateAfterLayout,
};
enum CompositingStateTransitionType {
......@@ -101,8 +102,6 @@ public:
// Used to indicate that a compositing update will be needed for the next frame that gets drawn.
void setNeedsCompositingUpdate(CompositingUpdateType);
void didLayout();
enum UpdateLayerCompositingStateOptions {
Normal,
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