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

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

Issue 2793233002: Remove begin/end subseq. display items, and store on PaintController instead. (Closed)
Patch Set: none Created 3 years, 8 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 | « third_party/WebKit/Source/platform/graphics/paint/SubsequenceDisplayItem.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 371baf0346f88df6057e1a46a2d4b6e420d023e0..0a67e06fc58ad81cbca90df64a1eadc9650d5c58 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp
@@ -7,7 +7,6 @@
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/paint/PaintController.h"
-#include "platform/graphics/paint/SubsequenceDisplayItem.h"
namespace blink {
@@ -20,26 +19,27 @@ SubsequenceRecorder::SubsequenceRecorder(GraphicsContext& context,
return;
m_beginSubsequenceIndex = m_paintController.newDisplayItemList().size();
- m_paintController.createAndAppend<BeginSubsequenceDisplayItem>(m_client);
+
+#if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
+ m_paintController.beginSubsequence(m_client);
+#endif
}
SubsequenceRecorder::~SubsequenceRecorder() {
+#if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
+ m_paintController.endSubsequence();
+#endif
+
if (m_paintController.displayItemConstructionIsDisabled())
return;
- if (m_paintController.lastDisplayItemIsNoopBegin()) {
- ASSERT(m_beginSubsequenceIndex ==
- m_paintController.newDisplayItemList().size() - 1);
- // Remove uncacheable no-op BeginSubsequence/EndSubsequence pairs.
- // Don't remove cacheable no-op pairs because we need to match them later
- // with CachedSubsequences.
- if (m_paintController.newDisplayItemList().last().skippedCache()) {
- m_paintController.removeLastDisplayItem();
- return;
- }
- }
-
- m_paintController.createAndAppend<EndSubsequenceDisplayItem>(m_client);
+ // Skip empty subsequences.
+ if (m_paintController.newDisplayItemList().size() == m_beginSubsequenceIndex)
+ return;
+
+ m_paintController.addCachedSubsequence(
+ m_client, m_beginSubsequenceIndex,
+ m_paintController.newDisplayItemList().size() - 1);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/SubsequenceDisplayItem.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698