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

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

Issue 2675773003: Optimize CompositingRecorder::endCompositing to not need an SkPictureBuilder (Closed)
Patch Set: rebase Created 3 years, 11 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/DrawingRecorder.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp b/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp
index 2e5303c2246830dead4a8fa870497ea1bb31be5d..5d9b202f866c66c67047d52ba7e74aaa033cb9ff 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp
@@ -12,6 +12,12 @@
namespace blink {
+#if DCHECK_IS_ON()
+static bool gListModificationCheckDisabled = false;
+DisableListModificationCheck::DisableListModificationCheck()
+ : m_disabler(&gListModificationCheckDisabled, true) {}
+#endif
+
DrawingRecorder::DrawingRecorder(GraphicsContext& context,
const DisplayItemClient& displayItemClient,
DisplayItem::Type displayItemType,
@@ -22,7 +28,7 @@ DrawingRecorder::DrawingRecorder(GraphicsContext& context,
m_knownToBeOpaque(false)
#if DCHECK_IS_ON()
,
- m_displayItemPosition(
+ m_initialDisplayItemListSize(
m_context.getPaintController().newDisplayItemList().size())
#endif
{
@@ -75,8 +81,11 @@ DrawingRecorder::~DrawingRecorder() {
m_context.restore();
m_context.setInDrawingRecorder(false);
- DCHECK(m_displayItemPosition ==
- m_context.getPaintController().newDisplayItemList().size());
+
+ if (!gListModificationCheckDisabled) {
+ DCHECK(m_initialDisplayItemListSize ==
+ m_context.getPaintController().newDisplayItemList().size());
+ }
#endif
sk_sp<const SkPicture> picture = m_context.endRecording();

Powered by Google App Engine
This is Rietveld 408576698