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

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

Issue 2161253003: Revert of PaintChunk::id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@CommitOnTheWay
Patch Set: Created 4 years, 5 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: 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 f076a8c606334772f77382089761c041fede8fad..e3dc42b883a6c58de348012f02eefe01a20808d0 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h
@@ -63,11 +63,7 @@
PaintInvalidationReason getPaintInvalidationReason() const { return m_cacheGenerationOrInvalidationReason.getPaintInvalidationReason(); }
- // A client is considered "just created" if its display items have never been committed.
- bool isJustCreated() const { return m_cacheGenerationOrInvalidationReason.isJustCreated(); }
-
private:
- friend class FakeDisplayItemClient;
friend class PaintController;
// Holds a unique cache generation id of DisplayItemClients and PaintControllers,
@@ -85,16 +81,12 @@
// only. The client will be treated as invalid on other paint controllers regardless if
// it's validly cached by these paint controllers. The situation is very rare (about 0.07%
// clients were painted on multiple paint controllers) so the performance penalty is trivial.
- class PLATFORM_EXPORT CacheGenerationOrInvalidationReason {
+ class CacheGenerationOrInvalidationReason {
DISALLOW_NEW();
public:
- CacheGenerationOrInvalidationReason() : m_value(kJustCreated) { }
+ CacheGenerationOrInvalidationReason() { invalidate(); }
- void invalidate(PaintInvalidationReason reason = PaintInvalidationFull)
- {
- if (m_value != kJustCreated)
- m_value = static_cast<ValueType>(reason);
- }
+ void invalidate(PaintInvalidationReason reason = PaintInvalidationFull) { m_value = static_cast<ValueType>(reason); }
static CacheGenerationOrInvalidationReason next()
{
@@ -111,17 +103,14 @@
PaintInvalidationReason getPaintInvalidationReason() const
{
- return m_value < kJustCreated ? static_cast<PaintInvalidationReason>(m_value) : PaintInvalidationNone;
+ return m_value < kFirstValidGeneration ? static_cast<PaintInvalidationReason>(m_value) : PaintInvalidationNone;
}
-
- bool isJustCreated() const { return m_value == kJustCreated; }
private:
typedef uint32_t ValueType;
explicit CacheGenerationOrInvalidationReason(ValueType value) : m_value(value) { }
- static const ValueType kJustCreated = static_cast<ValueType>(PaintInvalidationReasonMax) + 1;
- static const ValueType kFirstValidGeneration = static_cast<ValueType>(PaintInvalidationReasonMax) + 2;
+ static const ValueType kFirstValidGeneration = static_cast<ValueType>(PaintInvalidationReasonMax) + 1;
static ValueType s_nextGeneration;
ValueType m_value;
};

Powered by Google App Engine
This is Rietveld 408576698