| 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 eda39ff41e03e75780a895899090a8b53065cbcf..b9edbba2ab4b43aae356535d4854d61c6f3537ed 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.h
|
| +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.h
|
| @@ -163,6 +163,15 @@
|
| return m_trackedPaintInvalidationObjects ? *m_trackedPaintInvalidationObjects : Vector<String>();
|
| }
|
|
|
| + bool clientHasCheckedPaintInvalidation(const DisplayItemClient& client) const
|
| + {
|
| + return m_clientsCheckedPaintInvalidation.contains(&client);
|
| + }
|
| + void setClientHasCheckedPaintInvalidation(const DisplayItemClient& client)
|
| + {
|
| + m_clientsCheckedPaintInvalidation.add(&client);
|
| + }
|
| +
|
| #if ENABLE(ASSERT)
|
| void assertDisplayItemClientsAreLive();
|
| #endif
|
| @@ -170,18 +179,20 @@
|
| protected:
|
| PaintController()
|
| : m_newDisplayItemList(kInitialDisplayItemListCapacityBytes)
|
| + , m_validlyCachedClientsDirty(false)
|
| , m_constructionDisabled(false)
|
| , m_subsequenceCachingDisabled(false)
|
| , m_textPainted(false)
|
| , m_imagePainted(false)
|
| , m_skippingCacheCount(0)
|
| , m_numCachedNewItems(0)
|
| - , m_nextScope(1)
|
| - { }
|
| + , m_nextScope(1) { }
|
|
|
| private:
|
| // Set new item state (scopes, cache skipping, etc) for a new item.
|
| void processNewItem(DisplayItem&);
|
| +
|
| + void updateValidlyCachedClientsIfNeeded() const;
|
|
|
| #ifndef NDEBUG
|
| WTF::String displayItemListAsDebugString(const DisplayItemList&) const;
|
| @@ -209,8 +220,6 @@
|
|
|
| void commitNewDisplayItemsInternal(const LayoutSize& offsetFromLayoutObject);
|
|
|
| - void updateCacheGeneration();
|
| -
|
| // The last complete paint artifact.
|
| // In SPv2, this includes paint chunks as well as display items.
|
| PaintArtifact m_currentPaintArtifact;
|
| @@ -218,6 +227,18 @@
|
| // Data being used to build the next paint artifact.
|
| 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
|
| @@ -254,8 +275,6 @@
|
| #endif
|
|
|
| OwnPtr<Vector<String>> m_trackedPaintInvalidationObjects;
|
| -
|
| - DisplayItemCacheGeneration m_currentCacheGeneration;
|
| };
|
|
|
| } // namespace blink
|
|
|