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

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

Issue 2614093002: Combine LayoutObject::previousPaintOffset and paintOffset in paint properties (Closed)
Patch Set: - Created 3 years, 11 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.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h
index 82075ad1ed24a2aa9211a8441f7cc133f7729b22..acf790de9e321718594748c25410df02a120073c 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -1575,9 +1575,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
// Called when the previous visual rect(s) is no longer valid.
virtual void clearPreviousVisualRects();
- const LayoutPoint& previousPaintOffset() const {
- return m_previousPaintOffset;
- }
+ const LayoutPoint& paintOffset() const { return m_paintOffset; }
PaintInvalidationReason fullPaintInvalidationReason() const {
return m_bitfields.fullPaintInvalidationReason();
@@ -1676,12 +1674,16 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
m_layoutObject.ensureIsReadyForPaintInvalidation();
}
+ // The following setters store the current values as calculated during the
+ // pre-paint tree walk. TODO(wangxianzhu): Add check of lifecycle states.
Xianzhu 2017/01/06 19:24:18 The TODO means I'm not sure for now if we can chec
pdr. 2017/01/06 19:40:01 SGTM What about the paintOffset accessor (line 15
Xianzhu 2017/01/06 22:12:18 I would like to defer the decision to the TODO. Fo
void setPreviousVisualRect(const LayoutRect& r) {
m_layoutObject.setPreviousVisualRect(r);
}
- void setPreviousPaintOffset(const LayoutPoint& p) {
+ void setPaintOffset(const LayoutPoint& p) {
DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
- m_layoutObject.m_previousPaintOffset = p;
+ DCHECK_EQ(m_layoutObject.document().lifecycle().state(),
+ DocumentLifecycle::InPrePaint);
+ m_layoutObject.m_paintOffset = p;
}
void setHasPreviousLocationInBacking(bool b) {
m_layoutObject.m_bitfields.setHasPreviousLocationInBacking(b);
@@ -1695,6 +1697,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
void setPreviousBackgroundObscured(bool b) {
m_layoutObject.setPreviousBackgroundObscured(b);
}
+
void clearPreviousVisualRects() {
m_layoutObject.clearPreviousVisualRects();
}
@@ -2445,7 +2448,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
// offset that will be used to paint the object on SPv2. It's used to detect
// paint offset change for paint invalidation on SPv2, and partial paint
// property tree update for SlimmingPaintInvalidation on SPv1 and SPv2.
- LayoutPoint m_previousPaintOffset;
+ LayoutPoint m_paintOffset;
// For SPv2 only. The ObjectPaintProperties structure holds references to the
// property tree nodes that are created by the layout object for painting.

Powered by Google App Engine
This is Rietveld 408576698