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

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

Issue 2495893002: Implement incremental paint property tree rebuilding (Closed)
Patch Set: Suppress main thread scrolling invalidation failures Created 4 years, 1 month 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 3f075ccad502e230bd8382001958ee48a2d70751..18779c9575d83ab09284ac6d38ad5882814989b7 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h
@@ -91,6 +91,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. See: See: https://crbug.com/664672.
+ 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