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

Unified Diff: Source/platform/graphics/paint/DrawingDisplayItem.h

Issue 1160223004: Avoid false-positives of under-invalidation checking (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix build break (release w/ assert) Created 5 years, 7 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: Source/platform/graphics/paint/DrawingDisplayItem.h
diff --git a/Source/platform/graphics/paint/DrawingDisplayItem.h b/Source/platform/graphics/paint/DrawingDisplayItem.h
index 1e8deb07ca8959551302e427135b27db070c8f73..1fa0e1a700ade80136d2d67c6cda38c602e3c776 100644
--- a/Source/platform/graphics/paint/DrawingDisplayItem.h
+++ b/Source/platform/graphics/paint/DrawingDisplayItem.h
@@ -15,6 +15,24 @@ namespace blink {
class PLATFORM_EXPORT DrawingDisplayItem : public DisplayItem {
public:
+#if ENABLE(ASSERT)
+ enum UnderInvalidationCheckingMode {
+ CheckPicture, // Check if the new picture and the old picture are the same
+ CheckBitmap, // Check if the new picture and the old picture produce the same bitmap
+ DontCheck // Skip for known bugs. Each usage should have a FIXME and a link to the bug.
+ };
+#endif
+
+ DrawingDisplayItem(const DisplayItemClientWrapper& client, Type type, PassRefPtr<const SkPicture> picture)
+ : DisplayItem(client, type)
+ , m_picture(picture && picture->approximateOpCount() ? picture : nullptr)
+#if ENABLE(ASSERT)
+ , m_underInvalidationCheckingMode(CheckPicture)
+#endif
+ {
+ ASSERT(isDrawingType(type));
+ }
+
static PassOwnPtr<DrawingDisplayItem> create(const DisplayItemClientWrapper& client, Type type, PassRefPtr<const SkPicture> picture)
{
return adoptPtr(new DrawingDisplayItem(client, type, picture));
@@ -26,19 +44,9 @@ public:
PassRefPtr<const SkPicture> picture() const { return m_picture; }
- DrawingDisplayItem(const DisplayItemClientWrapper& client, Type type, PassRefPtr<const SkPicture> picture)
- : DisplayItem(client, type)
- , m_picture(picture && picture->approximateOpCount() ? picture : nullptr)
-#if ENABLE(ASSERT)
- , m_skipUnderInvalidationChecking(false)
-#endif
- {
- ASSERT(isDrawingType(type));
- }
-
#if ENABLE(ASSERT)
- void setSkipUnderInvalidationChecking() { m_skipUnderInvalidationChecking = true; }
- bool skipUnderInvalidationChecking() const { return m_skipUnderInvalidationChecking; }
+ void setUnderInvalidationCheckingMode(UnderInvalidationCheckingMode mode) { m_underInvalidationCheckingMode = mode; }
+ UnderInvalidationCheckingMode underInvalidationCheckingMode() const { return m_underInvalidationCheckingMode; }
#endif
private:
@@ -49,7 +57,7 @@ private:
RefPtr<const SkPicture> m_picture;
#if ENABLE(ASSERT)
- bool m_skipUnderInvalidationChecking;
+ UnderInvalidationCheckingMode m_underInvalidationCheckingMode;
#endif
};
« no previous file with comments | « Source/platform/graphics/paint/DisplayItemList.cpp ('k') | Source/platform/graphics/paint/DrawingRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698