Index: third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h |
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h |
index 4a6bdbbb5f32c4ffd2ccd09b1b5e9bf0ed787f00..383c57c4a145b599735722ff2a6eaa0c1a3ad277 100644 |
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h |
+++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h |
@@ -64,14 +64,19 @@ |
// Tests if this DisplayItemClient object has been created and has not been deleted yet. |
bool isAlive() const; |
// Called when any DisplayItem of this DisplayItemClient is added into PaintController |
- // using PaintController::createAndAppend(). |
- void beginShouldKeepAlive(const void* paintController) const; |
+ // using PaintController::createAndAppend() or into a cached subsequence. |
+ void beginShouldKeepAlive(const void* owner) const; |
// Clears all should-keep-alive DisplayItemClients of a PaintController. Called after |
- // PaintController commits new display items. |
- static void endShouldKeepAliveAllClients(const void* paintController); |
+ // PaintController commits new display items or the subsequence owner is invalidated. |
+ static void endShouldKeepAliveAllClients(const void* owner); |
static void endShouldKeepAliveAllClients(); |
+ |
+ // Called to clear should-keep-alive of DisplayItemClients in a subsequence if this |
+ // object is a subsequence. |
+#define ON_DISPLAY_ITEM_CLIENT_INVALIDATION() endShouldKeepAliveAllClients(this) |
#else |
virtual ~DisplayItemClient() { } |
+#define ON_DISPLAY_ITEM_CLIENT_INVALIDATION() |
#endif |
virtual String debugName() const = 0; |
@@ -88,7 +93,11 @@ |
#define DISPLAY_ITEM_CACHE_STATUS_IMPLEMENTATION \ |
bool displayItemsAreCached(DisplayItemCacheGeneration cacheGeneration) const final { return m_cacheGeneration.matches(cacheGeneration); } \ |
void setDisplayItemsCached(DisplayItemCacheGeneration cacheGeneration) const final { m_cacheGeneration = cacheGeneration; } \ |
- void setDisplayItemsUncached() const final { m_cacheGeneration.invalidate(); } \ |
+ void setDisplayItemsUncached() const final \ |
+ { \ |
+ m_cacheGeneration.invalidate(); \ |
+ ON_DISPLAY_ITEM_CLIENT_INVALIDATION(); \ |
+ } \ |
mutable DisplayItemCacheGeneration m_cacheGeneration; |
#define DISPLAY_ITEM_CACHE_STATUS_UNCACHEABLE_IMPLEMENTATION \ |