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

Unified Diff: Source/platform/graphics/paint/ScrollDisplayItem.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/ScrollDisplayItem.h
diff --git a/Source/platform/graphics/paint/ScrollDisplayItem.h b/Source/platform/graphics/paint/ScrollDisplayItem.h
index c4522a1b27362f463c9282d02a0575fa195a97c9..1f0fce468b27d45514d17b94e05ad26d672357c3 100644
--- a/Source/platform/graphics/paint/ScrollDisplayItem.h
+++ b/Source/platform/graphics/paint/ScrollDisplayItem.h
@@ -12,7 +12,7 @@
namespace blink {
-class PLATFORM_EXPORT BeginScrollDisplayItem : public DisplayItem {
+class PLATFORM_EXPORT BeginScrollDisplayItem : public PairedBeginDisplayItem {
WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<BeginScrollDisplayItem> create(DisplayItemClient client, Type type, const IntSize& currentOffset)
@@ -21,8 +21,11 @@ public:
}
BeginScrollDisplayItem(DisplayItemClient client, Type type, const IntSize& currentOffset)
- : DisplayItem(client, type)
- , m_currentOffset(currentOffset) { }
+ : PairedBeginDisplayItem(client, type)
+ , m_currentOffset(currentOffset)
+ {
+ ASSERT(isScrollType(type));
+ }
virtual void replay(GraphicsContext*) override;
virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override;
@@ -31,7 +34,7 @@ private:
const IntSize m_currentOffset;
};
-class PLATFORM_EXPORT EndScrollDisplayItem : public DisplayItem {
+class PLATFORM_EXPORT EndScrollDisplayItem : public PairedEndDisplayItem {
WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<EndScrollDisplayItem> create(DisplayItemClient client, Type type)
@@ -40,10 +43,18 @@ public:
}
EndScrollDisplayItem(DisplayItemClient client, Type type)
- : DisplayItem(client, type) { }
+ : PairedEndDisplayItem(client, type)
+ {
+ ASSERT(isEndScrollType(type));
+ }
virtual void replay(GraphicsContext*) override;
virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override;
+
+private:
+#if ENABLE(ASSERT)
+ virtual bool isEndAndPairedWith(const DisplayItem& other) const override final { return other.isScroll(); }
+#endif
};
} // namespace blink
« no previous file with comments | « Source/platform/graphics/paint/FloatClipDisplayItem.h ('k') | Source/platform/graphics/paint/Transform3DDisplayItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698