| 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 dcf1ef2549f2e3d4ac5458ef4ba2ddfa5e469c4b..f95303263adbed94406c53188f7ce6e147047109 100644
|
| --- a/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| @@ -81,7 +81,7 @@
|
| #include "core/page/scrolling/ScrollingCoordinator.h"
|
| #include "core/paint/FramePainter.h"
|
| #include "core/paint/PaintLayer.h"
|
| -#include "core/paint/PaintPropertyTreeBuilder.h"
|
| +#include "core/paint/PrePaintTreeWalk.h"
|
| #include "core/plugins/PluginView.h"
|
| #include "core/style/ComputedStyle.h"
|
| #include "core/svg/SVGDocumentExtensions.h"
|
| @@ -1080,6 +1080,8 @@ void FrameView::layout()
|
|
|
| void FrameView::invalidateTreeIfNeeded(PaintInvalidationState& paintInvalidationState)
|
| {
|
| + ASSERT(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
|
| +
|
| if (shouldThrottleRendering())
|
| return;
|
|
|
| @@ -2396,7 +2398,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::PrePaintTreeWalkClean) {
|
| // Schedule visual update to process the paint invalidation in the next cycle.
|
| localFrameRoot->scheduleVisualUpdateUnlessThrottled();
|
| }
|
| @@ -2442,7 +2446,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();
|
| @@ -2452,7 +2457,7 @@ void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases)
|
| }
|
|
|
| if (phases == AllPhases) {
|
| - if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
|
| + if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() || RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
|
| updatePaintProperties();
|
|
|
| if (!m_frame->document()->printing())
|
| @@ -2477,11 +2482,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);
|
| - forAllNonThrottledFrameViews([](FrameView& frameView) { frameView.lifecycle().advanceTo(DocumentLifecycle::UpdatePaintPropertiesClean); });
|
| + forAllNonThrottledFrameViews([](FrameView& frameView) { frameView.lifecycle().advanceTo(DocumentLifecycle::InPrePaintTreeWalk); });
|
| + PrePaintTreeWalk builder;
|
| + builder.buildPropertyTreesAndInvalidatePaint(*this);
|
| + forAllNonThrottledFrameViews([](FrameView& frameView) { frameView.lifecycle().advanceTo(DocumentLifecycle::PrePaintTreeWalkClean); });
|
| +
|
| + // 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()
|
| @@ -2650,6 +2660,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
|
|
|