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

Unified Diff: Source/platform/graphics/paint/ClipDisplayItem.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
« no previous file with comments | « Source/core/paint/LayerPainter.cpp ('k') | Source/platform/graphics/paint/ClipPathDisplayItem.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/paint/ClipDisplayItem.h
diff --git a/Source/platform/graphics/paint/ClipDisplayItem.h b/Source/platform/graphics/paint/ClipDisplayItem.h
index 2badc69ebc5eca1ec33d3e27d5bbbabd352c1793..8c48a63123fd76eb4fa1b37e40efb9bdd42da13f 100644
--- a/Source/platform/graphics/paint/ClipDisplayItem.h
+++ b/Source/platform/graphics/paint/ClipDisplayItem.h
@@ -15,7 +15,7 @@
namespace blink {
-class PLATFORM_EXPORT ClipDisplayItem : public DisplayItem {
+class PLATFORM_EXPORT ClipDisplayItem : public PairedBeginDisplayItem {
WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<ClipDisplayItem> create(DisplayItemClient client, Type type, const IntRect& clipRect, SkRegion::Op operation = SkRegion::kIntersect_Op)
@@ -24,7 +24,7 @@ public:
}
ClipDisplayItem(DisplayItemClient client, Type type, const IntRect& clipRect, SkRegion::Op operation = SkRegion::kIntersect_Op)
- : DisplayItem(client, type)
+ : PairedBeginDisplayItem(client, type)
, m_clipRect(clipRect)
, m_operation(operation)
{
@@ -45,7 +45,7 @@ private:
SkRegion::Op m_operation;
};
-class PLATFORM_EXPORT EndClipDisplayItem : public DisplayItem {
+class PLATFORM_EXPORT EndClipDisplayItem : public PairedEndDisplayItem {
WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<EndClipDisplayItem> create(DisplayItemClient client, Type type)
@@ -54,13 +54,18 @@ public:
}
EndClipDisplayItem(DisplayItemClient client, Type type)
- : DisplayItem(client, type)
+ : PairedEndDisplayItem(client, type)
{
- isEndClipType(type);
+ ASSERT(isEndClipType(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.isClip(); }
+#endif
};
} // namespace blink
« no previous file with comments | « Source/core/paint/LayerPainter.cpp ('k') | Source/platform/graphics/paint/ClipPathDisplayItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698