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

Unified Diff: Source/platform/graphics/paint/DisplayItemList.cpp

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/platform/graphics/paint/DisplayItem.h ('k') | Source/platform/graphics/paint/FilterDisplayItem.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/paint/DisplayItemList.cpp
diff --git a/Source/platform/graphics/paint/DisplayItemList.cpp b/Source/platform/graphics/paint/DisplayItemList.cpp
index 654b7f0f91cdd8b22e890f7a4ffc863255fe0217..783e1589c55b89f870bc610c822d9b4de3811b56 100644
--- a/Source/platform/graphics/paint/DisplayItemList.cpp
+++ b/Source/platform/graphics/paint/DisplayItemList.cpp
@@ -25,6 +25,16 @@ const PaintList& DisplayItemList::paintList()
void DisplayItemList::add(WTF::PassOwnPtr<DisplayItem> displayItem)
{
ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
+
+ if (displayItem->isEnd()) {
+ ASSERT(!m_newPaints.isEmpty());
+ if (m_newPaints.last()->isBegin()) {
+ ASSERT(displayItem->isEndAndPairedWith(*m_newPaints.last()));
+ // Remove empty pairs.
+ m_newPaints.removeLast();
+ return;
+ }
+ }
m_newPaints.append(displayItem);
}
« no previous file with comments | « Source/platform/graphics/paint/DisplayItem.h ('k') | Source/platform/graphics/paint/FilterDisplayItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698