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

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

Issue 1774193002: New paint invalidation using paint property tree walk (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Correct tracking of paintInvalidationContainer Created 4 years, 9 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
Index: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 7725566cd96de2cc4b460e883e9c67996694fa85..a6694bffd2a07873f8301d079b7c8b8a3d283431 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1079,6 +1079,8 @@ void FrameView::layout()
void FrameView::invalidateTreeIfNeeded(PaintInvalidationState& paintInvalidationState)
{
+ ASSERT(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
+
if (shouldThrottleRendering())
return;
@@ -2395,7 +2397,9 @@ void FrameView::updateLifecycleToLayoutClean()
void FrameView::scheduleVisualUpdateForPaintInvalidationIfNeeded()
{
LocalFrame* localFrameRoot = frame().localFrameRoot();
- if (!localFrameRoot->view()->m_isUpdatingAllLifecyclePhases || lifecycle().state() >= DocumentLifecycle::PaintInvalidationClean) {
+ if (!localFrameRoot->view()->m_isUpdatingAllLifecyclePhases
+ || (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && lifecycle().state() >= DocumentLifecycle::PaintInvalidationClean)
+ || lifecycle().state() >= DocumentLifecycle::UpdatePaintPropertiesClean) {
// Schedule visual update to process the paint invalidation in the next cycle.
localFrameRoot->scheduleVisualUpdateUnlessThrottled();
}
@@ -2441,7 +2445,8 @@ void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases)
ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean);
if (phases == AllPhases) {
- invalidateTreeIfNeededRecursive();
+ if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
+ invalidateTreeIfNeededRecursive();
if (view->compositor()->inCompositingMode())
scrollingCoordinator()->updateAfterCompositingChangeIfNeeded();
@@ -2451,7 +2456,7 @@ void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases)
}
if (phases == AllPhases) {
- if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() || RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
updatePaintProperties();
if (!m_frame->document()->printing())
@@ -2476,11 +2481,16 @@ void FrameView::updatePaintProperties()
{
TRACE_EVENT0("blink", "FrameView::updatePaintProperties");
- ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
+ ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled() || RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
forAllNonThrottledFrameViews([](FrameView& frameView) { frameView.lifecycle().advanceTo(DocumentLifecycle::InUpdatePaintProperties); });
- PaintPropertyTreeBuilder().buildPropertyTrees(*this);
+ PaintPropertyTreeBuilder builder;
+ builder.buildPropertyTrees(*this);
forAllNonThrottledFrameViews([](FrameView& frameView) { frameView.lifecycle().advanceTo(DocumentLifecycle::UpdatePaintPropertiesClean); });
+
+ // Process objects needing paint invalidation on the next frame. See the definition of PaintInvalidationDelayedFull for more details.
+ for (auto& target : builder.pendingDelayedPaintInvalidations())
+ target->setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull);
}
void FrameView::synchronizedPaint()
@@ -2649,6 +2659,7 @@ void FrameView::updateStyleAndLayoutIfNeededRecursive()
void FrameView::invalidateTreeIfNeededRecursive()
{
+ ASSERT(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
RELEASE_ASSERT(layoutView());
// We need to stop recursing here since a child frame view might not be throttled

Powered by Google App Engine
This is Rietveld 408576698