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

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

Issue 1363613002: Save previous paint offset in LayoutObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: No union (many compilers don't allow constructors); Fix a typo perhaps caused by switching to combiā€¦ 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5be3d0db2781b113becb8e6ad2e003ad48b1ca3a..b586c5449eaa7c98c88a1120ccbb146fefc1afdc 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -1138,6 +1138,17 @@ public:
m_previousPositionFromPaintInvalidationBacking = positionFromPaintInvalidationBacking;
}
+ const bool paintOffsetChanged(const LayoutPoint& newPaintOffset) const
+ {
+ ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
+ return m_previousPositionFromPaintInvalidationBacking != uninitializedPaintOffset() && m_previousPositionFromPaintInvalidationBacking != newPaintOffset;
+ }
+ void setPreviousPaintOffset(const LayoutPoint& paintOffset) const
+ {
+ ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
+ m_previousPositionFromPaintInvalidationBacking = paintOffset;
+ }
+
PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfields.fullPaintInvalidationReason(); }
bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInvalidationReason() != PaintInvalidationNone; }
void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalidationFull);
@@ -1396,6 +1407,8 @@ private:
const LayoutBoxModelObject* invalidatePaintRectangleInternal(const LayoutRect&) const;
+ static LayoutPoint uninitializedPaintOffset() { return LayoutPoint(LayoutUnit::max(), LayoutUnit::max()); }
+
RefPtr<ComputedStyle> m_style;
// Oilpan: raw pointer back to the owning Node is considered safe.
@@ -1641,7 +1654,10 @@ private:
// 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;
+ // For slimmingPaintOffsetCaching, this stores the previous paint offset.
+ // TODO(wangxianzhu): Rename this to m_previousPaintOffset when we enable slimmingPaintOffsetCaching.
+ // TODO(wangxianzhu): Better mutation control for painting.
+ mutable LayoutPoint m_previousPositionFromPaintInvalidationBacking;
};
// FIXME: remove this once the layout object lifecycle ASSERTS are no longer hit.
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698