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

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

Issue 1508223005: Client side display item cache flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 5 years 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/PaintController.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.h b/third_party/WebKit/Source/platform/graphics/paint/PaintController.h
index 7f7f5ce5fc0b59e81fd08d73f9a61a9fece9fdf7..28cfd3698168043030157ae8e08bdda28ed8d330 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.h
@@ -163,38 +163,32 @@ public:
return m_trackedPaintInvalidationObjects ? *m_trackedPaintInvalidationObjects : Vector<String>();
}
- bool clientHasCheckedPaintInvalidation(const DisplayItemClient& client) const
- {
- ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled());
- return m_clientsCheckedPaintInvalidation.contains(&client);
- }
- void setClientHasCheckedPaintInvalidation(const DisplayItemClient& client)
- {
- ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled());
- m_clientsCheckedPaintInvalidation.add(&client);
- }
-
#if ENABLE(ASSERT)
void assertDisplayItemClientsAreLive();
#endif
+ bool canUseClientCacheStatus() const { return m_canUseClientCacheStatus; }
+ void setCanUseClientCacheStatus(bool b) { m_canUseClientCacheStatus = b; }
+
+ unsigned currentCacheGeneration() const { return m_currentCacheGeneration; }
+
protected:
PaintController()
: m_newDisplayItemList(kInitialDisplayItemListCapacityBytes)
- , m_validlyCachedClientsDirty(false)
, m_constructionDisabled(false)
, m_textPainted(false)
, m_imagePainted(false)
, m_skippingCacheCount(0)
, m_numCachedNewItems(0)
- , m_nextScope(1) { }
+ , m_nextScope(1)
+ , m_canUseClientCacheStatus(false)
+ , m_currentCacheGeneration(DisplayItemClient::kInvalidCacheGeneration)
+ { }
private:
// Set new item state (scopes, cache skipping, etc) for a new item.
void processNewItem(DisplayItem&);
- void updateValidlyCachedClientsIfNeeded() const;
-
void invalidateClient(const DisplayItemClient&);
#ifndef NDEBUG
@@ -223,6 +217,9 @@ private:
void commitNewDisplayItemsInternal();
+ static unsigned nextCacheGeneration();
+ void updateCacheGeneration();
+
// The last complete paint artifact.
// In SPv2, this includes paint chunks as well as display items.
PaintArtifact m_currentPaintArtifact;
@@ -231,18 +228,6 @@ private:
DisplayItemList m_newDisplayItemList;
PaintChunker m_newPaintChunks;
- // Contains all clients having valid cached paintings if updated.
- // It's lazily updated in updateValidlyCachedClientsIfNeeded().
- // TODO(wangxianzhu): In the future we can replace this with client-side repaint flags
- // to avoid the cost of building and querying the hash table.
- mutable HashSet<const DisplayItemClient*> m_validlyCachedClients;
- mutable bool m_validlyCachedClientsDirty;
-
- // Used during painting. Contains clients that have checked paint invalidation and
- // are known to be valid.
- // TODO(wangxianzhu): Use client side flag to avoid const of hash table.
- HashSet<const DisplayItemClient*> m_clientsCheckedPaintInvalidation;
-
#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.
@@ -275,6 +260,9 @@ private:
#endif
OwnPtr<Vector<String>> m_trackedPaintInvalidationObjects;
+
+ bool m_canUseClientCacheStatus;
+ unsigned m_currentCacheGeneration;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698