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

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

Issue 1497873002: Make DisplayItemClient an interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 b62d5391553bd8bbad4b835d8e28fe7bf7d89b18..ad3fb8d8822fc7a0607a972463e1ed18e0c14a64 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.h
@@ -19,6 +19,7 @@
#include "platform/graphics/paint/Transform3DDisplayItem.h"
#include "wtf/Alignment.h"
#include "wtf/HashMap.h"
+#include "wtf/HashSet.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/Utility.h"
#include "wtf/Vector.h"
@@ -47,14 +48,14 @@ public:
// which might be painted into by the display item client, in coordinate space of the GraphicsLayer.
// TODO(pdr): define it for spv2.
// |visualRect| can be nullptr if we know it's unchanged and PaintController has cached the previous value.
- void invalidate(const DisplayItemClientWrapper&, PaintInvalidationReason, const IntRect* visualRect);
- void invalidateUntracked(DisplayItemClient);
+ void invalidate(const DisplayItemClient&, PaintInvalidationReason, const IntRect* visualRect);
+ void invalidateUntracked(const DisplayItemClient&);
void invalidateAll();
// Record when paint offsets change during paint.
- void invalidatePaintOffset(const DisplayItemClientWrapper&);
+ void invalidatePaintOffset(const DisplayItemClient&);
#if ENABLE(ASSERT)
- bool paintOffsetWasInvalidated(DisplayItemClient) const;
+ bool paintOffsetWasInvalidated(const DisplayItemClient&) const;
#endif
// These methods are called during painting.
@@ -123,7 +124,7 @@ public:
const DisplayItemList& displayItemList() const { return paintArtifact().displayItemList(); }
const Vector<PaintChunk>& paintChunks() const { return paintArtifact().paintChunks(); }
- bool clientCacheIsValid(DisplayItemClient) const;
+ bool clientCacheIsValid(const DisplayItemClient&) const;
bool cacheIsEmpty() const { return m_currentPaintArtifact.isEmpty(); }
bool displayItemConstructionIsDisabled() const { return m_constructionDisabled; }
@@ -158,15 +159,15 @@ public:
return m_trackedPaintInvalidationObjects ? *m_trackedPaintInvalidationObjects : Vector<String>();
}
- bool clientHasCheckedPaintInvalidation(DisplayItemClient client) const
+ bool clientHasCheckedPaintInvalidation(const DisplayItemClient& client) const
{
ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled());
- return m_clientsCheckedPaintInvalidation.contains(client);
+ return m_clientsCheckedPaintInvalidation.contains(&client);
}
- void setClientHasCheckedPaintInvalidation(DisplayItemClient client)
+ void setClientHasCheckedPaintInvalidation(const DisplayItemClient& client)
{
ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled());
- m_clientsCheckedPaintInvalidation.add(client);
+ m_clientsCheckedPaintInvalidation.add(&client);
}
protected:
@@ -186,7 +187,7 @@ private:
void updateValidlyCachedClientsIfNeeded() const;
- void invalidateClient(const DisplayItemClientWrapper&);
+ void invalidateClient(const DisplayItemClient&);
#ifndef NDEBUG
WTF::String displayItemListAsDebugString(const DisplayItemList&) const;
@@ -194,7 +195,7 @@ private:
// Indices into PaintList of all DrawingDisplayItems and BeginSubsequenceDisplayItems of each client.
// Temporarily used during merge to find out-of-order display items.
- using DisplayItemIndicesByClientMap = HashMap<DisplayItemClient, Vector<size_t>>;
+ using DisplayItemIndicesByClientMap = HashMap<const DisplayItemClient*, Vector<size_t>>;
static size_t findMatchingItemFromIndex(const DisplayItem::Id&, const DisplayItemIndicesByClientMap&, const DisplayItemList&);
static void addItemToIndexIfNeeded(const DisplayItem&, size_t index, DisplayItemIndicesByClientMap&);
@@ -224,18 +225,18 @@ private:
// 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<DisplayItemClient> m_validlyCachedClients;
+ 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<DisplayItemClient> m_clientsCheckedPaintInvalidation;
+ 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.
- HashSet<DisplayItemClient> m_clientsWithPaintOffsetInvalidations;
+ HashSet<const DisplayItemClient*> m_clientsWithPaintOffsetInvalidations;
#endif
// Allow display item construction to be disabled to isolate the costs of construction

Powered by Google App Engine
This is Rietveld 408576698