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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h

Issue 2404213004: Implement incremental paint property tree rebuilding (Closed)
Patch Set: Cleanup needsUpdate finder construction, tighten reasons for updating a property subtree, misc clea… Created 4 years, 2 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/platform/graphics/paint/ScrollPaintPropertyNode.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h b/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h
index db2fa0ad73983146c23ba5ea544946d49d7492aa..b3ebb99eea154d91695242456c49eeb5849d65ff 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h
@@ -89,6 +89,32 @@ class PLATFORM_EXPORT ScrollPaintPropertyNode
}
void clearMainThreadScrollingReasons() { m_mainThreadScrollingReasons = 0; }
+#if DCHECK_IS_ON()
+ // The clone function is used by FindPropertiesNeedingUpdate.h for recording
+ // a scroll node before it has been updated, to later detect changes.
+ PassRefPtr<ScrollPaintPropertyNode> clone() const {
+ RefPtr<ScrollPaintPropertyNode> cloned =
+ adoptRef(new ScrollPaintPropertyNode(
+ m_parent, m_scrollOffsetTranslation, m_clip, m_bounds,
+ m_userScrollableHorizontal, m_userScrollableVertical));
+ cloned->addMainThreadScrollingReasons(m_mainThreadScrollingReasons);
+ return cloned;
+ }
+
+ // The equality operator is used by FindPropertiesNeedingUpdate.h for checking
+ // if a scroll node has changed.
+ bool operator==(const ScrollPaintPropertyNode& o) const {
+ // TODO(pdr): Check main thread scrolling reason equality as well. We do
+ // not yet mark nodes as needing a paint property update on main thread
+ // scrolling reason changes.
+ return m_parent == o.m_parent &&
+ m_scrollOffsetTranslation == o.m_scrollOffsetTranslation &&
+ m_clip == o.m_clip && m_bounds == o.m_bounds &&
+ m_userScrollableHorizontal == o.m_userScrollableHorizontal &&
+ m_userScrollableVertical == o.m_userScrollableVertical;
+ }
+#endif
+
private:
ScrollPaintPropertyNode(
PassRefPtr<ScrollPaintPropertyNode> parent,

Powered by Google App Engine
This is Rietveld 408576698