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

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

Issue 900653003: Avoid empty display item pairs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix try bot breakage Created 5 years, 10 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/DisplayItem.h
diff --git a/Source/platform/graphics/paint/DisplayItem.h b/Source/platform/graphics/paint/DisplayItem.h
index f5546cc15a78efad55e037f1f22a836782aefa80..c2c64e2c5283005ceddbbe8583bd29f1f7292587 100644
--- a/Source/platform/graphics/paint/DisplayItem.h
+++ b/Source/platform/graphics/paint/DisplayItem.h
@@ -185,6 +185,13 @@ public:
DEFINE_PAIRED_CATEGORY_METHODS(Scroll, scroll)
DEFINE_PAINT_PHASE_CONVERSION_METHOD(Scroll)
+ virtual bool isBegin() const { return false; }
+ virtual bool isEnd() const { return false; }
+
+#if ENABLE(ASSERT)
+ virtual bool isEndAndPairedWith(const DisplayItem& other) const { return false; }
+#endif
+
#ifndef NDEBUG
static WTF::String typeAsDebugString(DisplayItem::Type);
@@ -219,6 +226,26 @@ private:
#endif
};
-}
+class PLATFORM_EXPORT PairedBeginDisplayItem : public DisplayItem {
+protected:
+ PairedBeginDisplayItem(DisplayItemClient client, Type type) : DisplayItem(client, type) { }
+
+private:
+ virtual bool isBegin() const override final { return true; }
+};
+
+class PLATFORM_EXPORT PairedEndDisplayItem : public DisplayItem {
+protected:
+ PairedEndDisplayItem(DisplayItemClient client, Type type) : DisplayItem(client, type) { }
+
+#if ENABLE(ASSERT)
+ virtual bool isEndAndPairedWith(const DisplayItem& other) const override = 0;
+#endif
+
+private:
+ virtual bool isEnd() const override final { return true; }
+};
+
+} // namespace blink
#endif // DisplayItem_h
« no previous file with comments | « Source/platform/graphics/paint/CompositingDisplayItem.h ('k') | Source/platform/graphics/paint/DisplayItemList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698