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

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

Issue 1363613002: Save previous paint offset in LayoutObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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: Source/core/layout/LayoutObject.h
diff --git a/Source/core/layout/LayoutObject.h b/Source/core/layout/LayoutObject.h
index 5be3d0db2781b113becb8e6ad2e003ad48b1ca3a..771b6b0ea330838fb67585cbe4e1629061030089 100644
--- a/Source/core/layout/LayoutObject.h
+++ b/Source/core/layout/LayoutObject.h
@@ -1138,6 +1138,17 @@ public:
m_previousPositionFromPaintInvalidationBacking = positionFromPaintInvalidationBacking;
}
+ const LayoutPoint& previousPaintOffset() const
+ {
+ ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
+ return m_previousPaintOffset;
+ }
+ void setPreviousPaintOffset(const LayoutPoint& paintOffset) const
+ {
+ ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
+ m_previousPaintOffset = paintOffset;
+ }
+
PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfields.fullPaintInvalidationReason(); }
bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInvalidationReason() != PaintInvalidationNone; }
void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalidationFull);
@@ -1638,10 +1649,15 @@ private:
// adjustInvalidationRectForCompositedScrolling().
LayoutRect m_previousPaintInvalidationRect;
- // This stores the position in the paint invalidation backing's coordinate.
- // It is used to detect layoutObject shifts that forces a full invalidation.
- // This point does *not* account for composited scrolling. See adjustInvalidationRectForCompositedScrolling().
- LayoutPoint m_previousPositionFromPaintInvalidationBacking;
+ union {
+ // This stores the position in the paint invalidation backing's coordinate.
+ // It is used to detect layoutObject shifts that forces a full invalidation.
+ // This point does *not* account for composited scrolling. See adjustInvalidationRectForCompositedScrolling().
+ // TODO(wangxianzhu): Remove this when we enable slimmingPaintOffsetCaching.
+ LayoutPoint m_previousPositionFromPaintInvalidationBacking;
+ // For slimmingPaintOffsetCaching.
+ mutable LayoutPoint m_previousPaintOffset;
pdr. 2015/09/22 22:44:44 Do we need to track the initial state in order to
Xianzhu 2015/09/23 18:43:18 Done. Added uninitializedPaintOffset() for the ini
+ };
};
// FIXME: remove this once the layout object lifecycle ASSERTS are no longer hit.

Powered by Google App Engine
This is Rietveld 408576698