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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp

Issue 1375393002: Output subsequence for children layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix blink_platform_unittests and address pdr's comments 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: third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp b/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp
index 146a0352723d772664343bbb6d559903c527d521..749768194a09eb247f41ce0339d6d8a05652bbf0 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp
@@ -13,7 +13,7 @@
namespace blink {
-bool SubsequenceRecorder::useCachedSubsequenceIfPossible(GraphicsContext& context, const DisplayItemClientWrapper& client)
+bool SubsequenceRecorder::useCachedSubsequenceIfPossible(GraphicsContext& context, const DisplayItemClientWrapper& client, DisplayItem::Type type)
{
if (!RuntimeEnabledFeatures::slimmingPaintSubsequenceCachingEnabled())
return false;
@@ -26,7 +26,7 @@ bool SubsequenceRecorder::useCachedSubsequenceIfPossible(GraphicsContext& contex
if (!context.displayItemList()->clientCacheIsValid(client.displayItemClient()))
return false;
- context.displayItemList()->createAndAppend<CachedDisplayItem>(client, DisplayItem::CachedSubsequence);
+ context.displayItemList()->createAndAppend<CachedDisplayItem>(client, DisplayItem::subsequenceTypeToCachedSubsequenceType(type));
#if ENABLE(ASSERT)
// When under-invalidation checking is enabled, we output CachedSubsequence display item
@@ -38,10 +38,11 @@ bool SubsequenceRecorder::useCachedSubsequenceIfPossible(GraphicsContext& contex
return true;
}
-SubsequenceRecorder::SubsequenceRecorder(GraphicsContext& context, const DisplayItemClientWrapper& client)
+SubsequenceRecorder::SubsequenceRecorder(GraphicsContext& context, const DisplayItemClientWrapper& client, DisplayItem::Type type)
: m_displayItemList(context.displayItemList())
, m_client(client)
, m_beginSubsequenceIndex(0)
+ , m_type(type)
{
if (!RuntimeEnabledFeatures::slimmingPaintSubsequenceCachingEnabled())
return;
@@ -51,7 +52,7 @@ SubsequenceRecorder::SubsequenceRecorder(GraphicsContext& context, const Display
return;
m_beginSubsequenceIndex = m_displayItemList->newDisplayItems().size();
- m_displayItemList->createAndAppend<BeginSubsequenceDisplayItem>(m_client);
+ m_displayItemList->createAndAppend<BeginSubsequenceDisplayItem>(m_client, type);
}
SubsequenceRecorder::~SubsequenceRecorder()
@@ -72,7 +73,7 @@ SubsequenceRecorder::~SubsequenceRecorder()
}
}
- m_displayItemList->createAndAppend<EndSubsequenceDisplayItem>(m_client);
+ m_displayItemList->createAndAppend<EndSubsequenceDisplayItem>(m_client, DisplayItem::subsequenceTypeToEndSubsequenceType(m_type));
}
void SubsequenceRecorder::setUncacheable()
@@ -83,7 +84,7 @@ void SubsequenceRecorder::setUncacheable()
if (m_displayItemList->displayItemConstructionIsDisabled())
return;
- ASSERT(m_displayItemList->newDisplayItems()[m_beginSubsequenceIndex].type() == DisplayItem::BeginSubsequence);
+ ASSERT(m_displayItemList->newDisplayItems()[m_beginSubsequenceIndex].isSubsequence());
m_displayItemList->newDisplayItems()[m_beginSubsequenceIndex].setSkippedCache();
}

Powered by Google App Engine
This is Rietveld 408576698