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

Unified Diff: third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp

Issue 2707063003: Don't invalidate rect if it's covered by fully invalidated parent's visual rect (Closed)
Patch Set: Rebaseline on Linux 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
diff --git a/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
index eedca8d87b2e4e5ed0df5364011f1a75c4de5a89..8f72299d5337f38a32fd209e0f2509e45b1f7d3e 100644
--- a/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
@@ -338,6 +338,16 @@ void ObjectPaintInvalidator::setBackingNeedsPaintInvalidationInRect(
}
}
+static bool parentIsContainer(const LayoutObject& object) {
+ if (object.isTextOrSVGChild() ||
wkorman 2017/02/22 21:52:22 Is there a relevant spec section or something we c
Xianzhu 2017/02/22 23:20:59 The conditions are the same conditions that Layout
+ (!object.isOutOfFlowPositioned() && !object.isColumnSpanAll() &&
+ !object.isFloating())) {
+ DCHECK(object.parent() == object.container());
+ return true;
+ }
+ return false;
+}
+
void ObjectPaintInvalidator::invalidatePaintUsingContainer(
const LayoutBoxModelObject& paintInvalidationContainer,
const LayoutRect& dirtyRect,
@@ -358,7 +368,15 @@ void ObjectPaintInvalidator::invalidatePaintUsingContainer(
if (dirtyRect.isEmpty())
return;
- CHECK(m_object.isRooted());
+ DCHECK(m_object.isRooted());
wkorman 2017/02/22 21:52:22 Just curious, why shift to DCHECK?
Xianzhu 2017/02/22 23:20:59 isRooted() is slow because it traverse the layout/
+
+ if (m_object != paintInvalidationContainer && m_object.parent() &&
wkorman 2017/02/22 21:52:22 Could be worth adding a comment to explain backgro
+ m_object.parent() != paintInvalidationContainer &&
+ isImmediateFullPaintInvalidationReason(
+ m_object.parent()->fullPaintInvalidationReason()) &&
+ parentIsContainer(m_object) &&
+ m_object.parent()->visualRect().contains(dirtyRect))
+ return;
// FIXME: Unify "devtools.timeline.invalidationTracking" and
// "blink.invalidation". crbug.com/413527.
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698