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

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

Issue 1307653007: Fix assertion failure during out-of-order matching (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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/DisplayItemList.cpp
diff --git a/Source/platform/graphics/paint/DisplayItemList.cpp b/Source/platform/graphics/paint/DisplayItemList.cpp
index 47a2a271142de908223e1bb30dfdf75fb96cc7c6..26549edad91e283736402671bee3319308783c57 100644
--- a/Source/platform/graphics/paint/DisplayItemList.cpp
+++ b/Source/platform/graphics/paint/DisplayItemList.cpp
@@ -244,7 +244,7 @@ struct DisplayItemList::OutOfOrderIndexContext {
DisplayItemIndicesByClientMap displayItemIndicesByClient;
};
-DisplayItems::iterator DisplayItemList::findOutOfOrderCachedItem(DisplayItems::iterator currentIt, const DisplayItem::Id& id, OutOfOrderIndexContext& context)
+DisplayItems::iterator DisplayItemList::findOutOfOrderCachedItem(const DisplayItem::Id& id, OutOfOrderIndexContext& context)
{
ASSERT(clientCacheIsValid(id.client));
@@ -252,16 +252,12 @@ DisplayItems::iterator DisplayItemList::findOutOfOrderCachedItem(DisplayItems::i
if (foundIndex != kNotFound)
return m_currentDisplayItems.begin() + foundIndex;
- return findOutOfOrderCachedItemForward(currentIt, id, context);
+ return findOutOfOrderCachedItemForward(id, context);
}
// Find forward for the item and index all skipped indexable items.
-DisplayItems::iterator DisplayItemList::findOutOfOrderCachedItemForward(DisplayItems::iterator currentIt, const DisplayItem::Id& id, OutOfOrderIndexContext& context)
+DisplayItems::iterator DisplayItemList::findOutOfOrderCachedItemForward(const DisplayItem::Id& id, OutOfOrderIndexContext& context)
{
- // Items before currentIt should have been copied. Skip indexing of them.
- if (currentIt - context.nextItemToIndex > 0)
- context.nextItemToIndex = currentIt;
-
DisplayItems::iterator currentEnd = m_currentDisplayItems.end();
for (; context.nextItemToIndex != currentEnd; ++context.nextItemToIndex) {
const DisplayItem& item = *context.nextItemToIndex;
@@ -367,7 +363,7 @@ void DisplayItemList::commitNewDisplayItems(DisplayListDiff*)
ASSERT(newDisplayItem.isCached());
ASSERT(clientCacheIsValid(newDisplayItem.client()) || (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && !paintOffsetWasInvalidated(newDisplayItem.client())));
if (!isSynchronized) {
- currentIt = findOutOfOrderCachedItem(currentIt, newDisplayItemId, outOfOrderIndexContext);
+ currentIt = findOutOfOrderCachedItem(newDisplayItemId, outOfOrderIndexContext);
if (currentIt == currentEnd) {
#ifndef NDEBUG
@@ -406,6 +402,9 @@ void DisplayItemList::commitNewDisplayItems(DisplayListDiff*)
if (isSynchronized)
++currentIt;
}
+ // Items before currentIt should have been copied so we don't need to index them.
+ if (currentIt - outOfOrderIndexContext.nextItemToIndex > 0)
+ outOfOrderIndexContext.nextItemToIndex = currentIt;
}
#if ENABLE(ASSERT)
« no previous file with comments | « Source/platform/graphics/paint/DisplayItemList.h ('k') | Source/platform/graphics/paint/DisplayItemListTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698