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

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

Issue 2116693002: 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 e3dc42b883a6c58de348012f02eefe01a20808d0..3637d9660ce2b2561f9843655f7e3b52b00ea2cd 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h
@@ -63,7 +63,10 @@ public:
PaintInvalidationReason getPaintInvalidationReason() const { return m_cacheGenerationOrInvalidationReason.getPaintInvalidationReason(); }
+ bool isJustCreated() const { return m_cacheGenerationOrInvalidationReason.isJustCreated(); }
+
private:
+ friend class FakeDisplayItemClient;
friend class PaintController;
// Holds a unique cache generation id of DisplayItemClients and PaintControllers,
@@ -84,7 +87,7 @@ private:
class CacheGenerationOrInvalidationReason {
DISALLOW_NEW();
public:
- CacheGenerationOrInvalidationReason() { invalidate(); }
+ CacheGenerationOrInvalidationReason() : m_value(kJustCreated) { }
void invalidate(PaintInvalidationReason reason = PaintInvalidationFull) { m_value = static_cast<ValueType>(reason); }
@@ -103,14 +106,17 @@ private:
PaintInvalidationReason getPaintInvalidationReason() const
{
- return m_value < kFirstValidGeneration ? static_cast<PaintInvalidationReason>(m_value) : PaintInvalidationNone;
+ return m_value < kJustCreated ? 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 kFirstValidGeneration = static_cast<ValueType>(PaintInvalidationReasonMax) + 1;
+ static const ValueType kJustCreated = static_cast<ValueType>(PaintInvalidationReasonMax) + 1;
+ static const ValueType kFirstValidGeneration = static_cast<ValueType>(PaintInvalidationReasonMax) + 2;
static ValueType s_nextGeneration;
ValueType m_value;
};

Powered by Google App Engine
This is Rietveld 408576698