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

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

Issue 1315993004: Implement a paint offset cache for slimming paint v2 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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.cpp
diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp
index 6ddea1c970ff66b203ede634690f88b51eb529ca..53278ec708b66359f5084139d2a5b7478f3a6675 100644
--- a/Source/core/layout/LayoutObject.cpp
+++ b/Source/core/layout/LayoutObject.cpp
@@ -138,6 +138,7 @@ struct SameSizeAsLayoutObject {
unsigned m_bitfields2;
LayoutRect rect; // Stores the previous paint invalidation rect.
LayoutPoint position; // Stores the previous position from the paint invalidation container.
+ LayoutPoint paintOffset; // DO NOT COMMIT until https://codereview.chromium.org/1315213002 lands and we can remove this.
};
static_assert(sizeof(LayoutObject) == sizeof(SameSizeAsLayoutObject), "LayoutObject should stay small");
@@ -3188,6 +3189,18 @@ void LayoutObject::clearPaintInvalidationState(const PaintInvalidationState& pai
m_bitfields.setShouldInvalidateSelection(false);
}
+const LayoutPoint& LayoutObject::cachedPaintOffset() const
+{
+ ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
+ return m_cachedPaintOffset;
+}
+
+void LayoutObject::updateCachedPaintOffset(const LayoutPoint& paintOffset) const
+{
+ ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
+ m_cachedPaintOffset = paintOffset;
+}
+
bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document)
{
return DeprecatedDisableModifyLayoutTreeStructureAsserts::canModifyLayoutTreeStateInAnyState()

Powered by Google App Engine
This is Rietveld 408576698