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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2229643002: Don't invalidate paint on background image change if it's obscured (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@BackgroundObscured
Patch Set: - Created 4 years, 4 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/layout/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index a0e793746c6ce2100ebe4149b2e65b044d9e6fea..1ee94e7bf6d0d9f2b8d1b28926da734e88490930 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1396,7 +1396,7 @@ PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(const PaintInvalid
invalidationReason = PaintInvalidationBackgroundObscurationChange;
m_bitfields.setPreviousBackgroundObscured(backgroundObscured);
- if (invalidationReason == PaintInvalidationNone) {
+ if (invalidationReason == PaintInvalidationNone || invalidationReason == PaintInvalidationDelayedFull) {
// TODO(trchen): Currently we don't keep track of paint offset of layout objects.
// There are corner cases that the display items need to be invalidated for paint offset
// mutation, but incurs no pixel difference (i.e. bounds stay the same) so no rect-based
@@ -3427,6 +3427,14 @@ void LayoutObject::setMayNeedPaintInvalidationSubtree()
setMayNeedPaintInvalidation();
}
+void LayoutObject::setMayNeedPaintInvalidationAnimatgedBackgroundImage()
+{
+ if (mayNeedPaintInvalidationAnimatedBackgroundImage())
+ return;
+ m_bitfields.setMayNeedPaintInvalidationAnimatedBackgroundImage(true);
+ setMayNeedPaintInvalidation();
+}
+
void LayoutObject::clearPaintInvalidationFlags(const PaintInvalidationState& paintInvalidationState)
{
// paintInvalidationStateIsDirty should be kept in sync with the
@@ -3436,6 +3444,7 @@ void LayoutObject::clearPaintInvalidationFlags(const PaintInvalidationState& pai
m_bitfields.setChildShouldCheckForPaintInvalidation(false);
m_bitfields.setMayNeedPaintInvalidation(false);
m_bitfields.setMayNeedPaintInvalidationSubtree(false);
+ m_bitfields.setMayNeedPaintInvalidationAnimatedBackgroundImage(false);
m_bitfields.setShouldInvalidateSelection(false);
}

Powered by Google App Engine
This is Rietveld 408576698