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

Unified Diff: Source/platform/graphics/paint/DisplayItemList.h

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/platform/graphics/paint/DisplayItemList.h
diff --git a/Source/platform/graphics/paint/DisplayItemList.h b/Source/platform/graphics/paint/DisplayItemList.h
index ea3ad1b11ace8ecf07f55088e74860d0a826f3c0..46c61a39118ef104f7d919702c53965249d0e741 100644
--- a/Source/platform/graphics/paint/DisplayItemList.h
+++ b/Source/platform/graphics/paint/DisplayItemList.h
@@ -6,6 +6,7 @@
#define DisplayItemList_h
#include "platform/PlatformExport.h"
+#include "platform/geometry/LayoutPoint.h"
#include "platform/graphics/ContiguousContainer.h"
#include "platform/graphics/paint/DisplayItem.h"
#include "platform/graphics/paint/Transform3DDisplayItem.h"
@@ -46,6 +47,12 @@ public:
void invalidate(DisplayItemClient);
void invalidateAll();
+ // Record when paint offsets change during paint.
+ void invalidatePaintOffset(DisplayItemClient);
+#if ENABLE(ASSERT)
+ bool paintOffsetWasInvalidated(DisplayItemClient) const;
+#endif
+
// These methods are called during painting.
template <typename DisplayItemClass, typename... Args>
DisplayItemClass& createAndAppend(Args&&... args)
@@ -124,6 +131,7 @@ private:
friend class DisplayItemListPaintTest;
friend class DisplayItemListPaintTestForSlimmingPaintV2;
friend class LayoutObjectDrawingRecorderTest;
+ friend class LayoutObjectDrawingRecorderTestForSlimmingPaintV2;
// Set new item state (scopes, cache skipping, etc) for a new item.
// TODO(pdr): This only passes a pointer to make the patch easier to review. Change to a reference.
@@ -166,6 +174,12 @@ private:
mutable HashSet<DisplayItemClient> m_validlyCachedClients;
mutable bool m_validlyCachedClientsDirty;
+#if ENABLE(ASSERT)
+ // Set of clients which had paint offset changes since the last commit. This is used for
+ // ensuring paint offsets are only updated once and are the same in all phases.
+ HashSet<DisplayItemClient> m_clientsWithPaintOffsetInvalidations;
+#endif
+
// Allow display item construction to be disabled to isolate the costs of construction
// in performance metrics.
bool m_constructionDisabled;

Powered by Google App Engine
This is Rietveld 408576698