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

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

Issue 2804883006: Revert of Remove begin/end subseq. display items, and store on PaintController instead. (Closed)
Patch Set: 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 0a67e06fc58ad81cbca90df64a1eadc9650d5c58..371baf0346f88df6057e1a46a2d4b6e420d023e0 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp
@@ -7,6 +7,7 @@
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/paint/PaintController.h"
+#include "platform/graphics/paint/SubsequenceDisplayItem.h"
namespace blink {
@@ -19,27 +20,26 @@
return;
m_beginSubsequenceIndex = m_paintController.newDisplayItemList().size();
-
-#if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
- m_paintController.beginSubsequence(m_client);
-#endif
+ m_paintController.createAndAppend<BeginSubsequenceDisplayItem>(m_client);
}
SubsequenceRecorder::~SubsequenceRecorder() {
-#if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
- m_paintController.endSubsequence();
-#endif
-
if (m_paintController.displayItemConstructionIsDisabled())
return;
- // Skip empty subsequences.
- if (m_paintController.newDisplayItemList().size() == m_beginSubsequenceIndex)
- 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.addCachedSubsequence(
- m_client, m_beginSubsequenceIndex,
- m_paintController.newDisplayItemList().size() - 1);
+ m_paintController.createAndAppend<EndSubsequenceDisplayItem>(m_client);
}
} // 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