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

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

Issue 2671853003: [SPInvalidation] Use GeometryMapper in PaintLayerClipper for paint. (Closed)
Patch Set: Merge branch 'master' into paintlayerclipper Created 3 years, 10 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 62fef414a6f1da0f9bd3973152b15031c08db376..726bfa33117807c48f41bb8dd859f5329bec1254 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -2822,6 +2822,19 @@ void FrameView::updateWidgetGeometriesIfNeeded() {
updateWidgetGeometries();
}
+GeometryMapper& FrameView::geometryMapper() {
+ DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
+ DCHECK(lifecycle().state() >= DocumentLifecycle::InPrePaint);
+
+ if (m_frame->isLocalRoot()) {
+ if (!m_geometryMapper)
+ m_geometryMapper = GeometryMapper::create();
+ return *m_geometryMapper.get();
+ }
+
+ return frame().localFrameRoot()->view()->geometryMapper();
+}
+
void FrameView::updateAllLifecyclePhases() {
frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(
DocumentLifecycle::PaintClean);
@@ -3074,12 +3087,6 @@ void FrameView::prePaint() {
if (!m_paintController)
m_paintController = PaintController::create();
- if (!m_geometryMapper)
- m_geometryMapper.reset(new GeometryMapper());
- // TODO(chrishtr): the cache only needs to be invalidated if one or more of
- // the property tree nodes changed.
- m_geometryMapper->clearCache();
-
forAllNonThrottledFrameViews([](FrameView& frameView) {
frameView.lifecycle().advanceTo(DocumentLifecycle::InPrePaint);
if (frameView.canThrottleRendering()) {
@@ -3092,8 +3099,14 @@ void FrameView::prePaint() {
});
if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
+ // TODO(chrishtr): the cache only needs to be invalidated if one or more of
+ // the property tree nodes changed.
+ geometryMapper().clearCache();
+ }
+
+ if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime");
- PrePaintTreeWalk(*m_geometryMapper).walk(*this);
+ PrePaintTreeWalk(geometryMapper()).walk(*this);
}
forAllNonThrottledFrameViews([](FrameView& frameView) {
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698