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

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

Issue 1327563003: Don't cache subsequence whose layer is not fully contained by repaint rect (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: For review 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/SubsequenceRecorder.cpp
diff --git a/Source/platform/graphics/paint/SubsequenceRecorder.cpp b/Source/platform/graphics/paint/SubsequenceRecorder.cpp
index 4f54dbff0cc2797c37d6c7e5174a82f4f75ef98c..a45358459d5162723b5c56142e90ff2da14d2edf 100644
--- a/Source/platform/graphics/paint/SubsequenceRecorder.cpp
+++ b/Source/platform/graphics/paint/SubsequenceRecorder.cpp
@@ -33,11 +33,13 @@ bool SubsequenceRecorder::useCachedSubsequenceIfPossible(GraphicsContext& contex
SubsequenceRecorder::SubsequenceRecorder(GraphicsContext& context, const DisplayItemClientWrapper& client)
: m_displayItemList(context.displayItemList())
, m_client(client)
+ , m_beginSubsequenceIndex(0)
{
if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled())
return;
ASSERT(m_displayItemList);
+ m_beginSubsequenceIndex = m_displayItemList->newDisplayItems().size();
chrishtr 2015/09/08 22:48:00 You only need access to the size, not the whole ve
Xianzhu 2015/09/09 16:50:33 It's also needed to set uncacheable flag or a prev
m_displayItemList->createAndAppend<BeginSubsequenceDisplayItem>(m_client);
}
@@ -46,9 +48,19 @@ SubsequenceRecorder::~SubsequenceRecorder()
if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled())
return;
- // Don't remove no-op BeginSubsequence/EndSubsequence pairs because we need to
- // match them later with CachedSubsequences.
- m_displayItemList->createAndAppend<EndSubsequenceDisplayItem>(m_client);
+ if (m_displayItemList->lastDisplayItemIsNoopBegin())
+ m_displayItemList->removeLastDisplayItem();
+ else
+ m_displayItemList->createAndAppend<EndSubsequenceDisplayItem>(m_client);
+}
+
+void SubsequenceRecorder::setUncacheable()
+{
+ if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled())
+ return;
+
+ ASSERT(m_displayItemList->newDisplayItems()[m_beginSubsequenceIndex].type() == DisplayItem::BeginSubsequence);
+ m_displayItemList->newDisplayItems()[m_beginSubsequenceIndex].setUncacheable();
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698