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

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

Issue 1209133002: Traverse into child LayoutViews during invalidateTreeIfNeeded (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: public invalidateTreeIfNeeded Created 5 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') | Source/core/layout/LayoutObject.h » ('j') | 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 79009f972ba2f911f6ad9fab63c014e3bc887fee..d55aa51fd1ce1e910e2779f6d0e3fd5ccd3d6e53 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -1099,21 +1099,21 @@ void FrameView::layout()
// method would setNeedsRedraw on the GraphicsLayers with invalidations and
// let the compositor pick which to actually draw.
// See http://crbug.com/306706
-void FrameView::invalidateTreeIfNeeded(Vector<LayoutObject*>& pendingDelayedPaintInvalidations)
+void FrameView::invalidateTreeIfNeeded(PaintInvalidationState& paintInvalidationState)
{
+ lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation);
+
ASSERT(layoutView());
LayoutView& rootForPaintInvalidation = *layoutView();
ASSERT(!rootForPaintInvalidation.needsLayout());
TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInvalidation.debugName().ascii());
- PaintInvalidationState rootPaintInvalidationState(rootForPaintInvalidation, pendingDelayedPaintInvalidations);
-
// In slimming paint mode we do per-object invalidation.
if (m_doFullPaintInvalidation && !RuntimeEnabledFeatures::slimmingPaintEnabled())
layoutView()->compositor()->fullyInvalidatePaint();
- rootForPaintInvalidation.invalidateTreeIfNeeded(rootPaintInvalidationState);
+ rootForPaintInvalidation.invalidateTreeIfNeeded(paintInvalidationState);
// Invalidate the paint of the frameviews scrollbars if needed
if (hasVerticalBarDamage())
@@ -1128,6 +1128,9 @@ void FrameView::invalidateTreeIfNeeded(Vector<LayoutObject*>& pendingDelayedPain
if (m_frame->selection().isCaretBoundsDirty())
m_frame->selection().invalidateCaretRect();
+
+ m_doFullPaintInvalidation = false;
+ lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean);
}
DocumentLifecycle& FrameView::lifecycle() const
@@ -2586,23 +2589,27 @@ void FrameView::updateLayoutAndStyleIfNeededRecursive()
void FrameView::invalidateTreeIfNeededRecursive()
{
- // FIXME: We should be more aggressive at cutting tree traversals.
- lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation);
+ ASSERT(layoutView());
+ TRACE_EVENT1("blink", "FrameView::invalidateTreeIfNeededRecursive", "root", layoutView()->debugName().ascii());
Vector<LayoutObject*> pendingDelayedPaintInvalidations;
+ PaintInvalidationState rootPaintInvalidationState(*layoutView(), pendingDelayedPaintInvalidations);
- invalidateTreeIfNeeded(pendingDelayedPaintInvalidations);
+ invalidateTreeIfNeeded(rootPaintInvalidationState);
+ // Some frames may be not reached during the above invalidateTreeIfNeeded because
+ // - the frame is a detached frame; or
+ // - it didn't need paint invalidation.
+ // We need to call invalidateTreeIfNeededRecursive() for such frames to finish required
+ // paint invalidation and advance their life cycle state.
for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree().nextSibling()) {
if (!child->isLocalFrame())
continue;
-
- toLocalFrame(child)->view()->invalidateTreeIfNeededRecursive();
+ FrameView* childFrameView = toLocalFrame(child)->view();
+ if (childFrameView->lifecycle().state() < DocumentLifecycle::PaintInvalidationClean)
+ childFrameView->invalidateTreeIfNeededRecursive();
}
- m_doFullPaintInvalidation = false;
- lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean);
-
// Process objects needing paint invalidation on the next frame. See the definition of PaintInvalidationDelayedFull for more details.
for (auto& target : pendingDelayedPaintInvalidations)
target->setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull);
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698