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

Unified Diff: Source/core/frame/FrameView.cpp

Issue 351673007: Move paint invalidation after compositing update (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added the missing TestExpectation suppressions 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/frame/FrameView.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index d3b7df87c8e0010f8ceae211e586db22bec0130d..efbcef1cccd5f11cdd79bc6a0bd88e1713b5a050 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -952,6 +952,11 @@ void FrameView::layout(bool allowSubtree)
performLayout(rootForThisLayout, inSubtreeLayout);
m_layoutSubtreeRoot = 0;
+ // We need to ensure that we mark up all renderers up to the RenderView
+ // for paint invalidation. This simplifies our code as we just always
+ // do a full tree walk.
+ if (RenderObject* container = rootForThisLayout->container())
+ container->setMayNeedPaintInvalidation(true);
} // Reset m_layoutSchedulingEnabled to its previous value.
if (!inSubtreeLayout && !toRenderView(rootForThisLayout)->document().printing())
@@ -984,10 +989,6 @@ void FrameView::layout(bool allowSubtree)
if (m_nestedLayoutCount)
return;
- invalidateTree(rootForThisLayout);
-
- m_doFullPaintInvalidation = false;
-
#ifndef NDEBUG
// Post-layout assert that nobody was re-marked as needing layout during layout.
document->renderView()->assertSubtreeIsLaidOut();
@@ -1007,22 +1008,16 @@ void FrameView::layout(bool allowSubtree)
// method would setNeedsRedraw on the GraphicsLayers with invalidations and
// let the compositor pick which to actually draw.
// See http://crbug.com/306706
-void FrameView::invalidateTree(RenderObject* root)
+void FrameView::invalidateTreeIfNeeded()
{
- ASSERT(!root->needsLayout());
- // We should only invalidate paints for the outer most layout. This works as
- // we continue to track paint invalidation rects until this function is called.
- ASSERT(!m_nestedLayoutCount);
-
- TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", root->debugName().ascii());
+ RenderObject* rootForPaintInvalidation = renderView();
+ ASSERT(!rootForPaintInvalidation->needsLayout());
- // FIXME: really, we're in the paint invalidation phase here, and the compositing queries are legal.
- // Until those states are fully fledged, I'll just disable the ASSERTS.
- DisableCompositingQueryAsserts compositingQueryAssertsDisabler;
+ TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInvalidation->debugName().ascii());
- LayoutState rootLayoutState(*root);
+ LayoutState rootLayoutState(*rootForPaintInvalidation);
- root->invalidateTreeAfterLayout(*root->containerForPaintInvalidation());
+ rootForPaintInvalidation->invalidateTreeAfterLayout(*rootForPaintInvalidation->containerForPaintInvalidation());
// Invalidate the paint of the frameviews scrollbars if needed
if (hasVerticalBarDamage())
@@ -1030,6 +1025,8 @@ void FrameView::invalidateTree(RenderObject* root)
if (hasHorizontalBarDamage())
invalidateRect(horizontalBarDamage());
resetScrollbarDamage();
+
+ m_doFullPaintInvalidation = false;
}
DocumentLifecycle& FrameView::lifecycle() const
@@ -2820,6 +2817,8 @@ void FrameView::updateLayoutAndStyleForPainting()
m_frame->page()->scrollingCoordinator()->updateAfterCompositingChangeIfNeeded();
InspectorInstrumentation::didUpdateLayerTree(view->frame());
+
+ invalidateTreeIfNeededRecursive();
}
scrollContentsIfNeededRecursive();
@@ -2875,6 +2874,19 @@ void FrameView::updateLayoutAndStyleIfNeededRecursive()
}
+void FrameView::invalidateTreeIfNeededRecursive()
+{
+ // FIXME: We should be more aggressive at cutting tree traversals.
+ invalidateTreeIfNeeded();
+
+ for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree().nextSibling()) {
+ if (!child->isLocalFrame())
+ continue;
+
+ toLocalFrame(child)->view()->invalidateTreeIfNeededRecursive();
+ }
+}
+
void FrameView::enableAutoSizeMode(bool enable, const IntSize& minSize, const IntSize& maxSize)
{
ASSERT(!enable || !minSize.isEmpty());
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698