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

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

Issue 1841833002: Deal gracefully with null {GraphicsContext,SkPictureBuilder}.endRecording() results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't end recording twice in DrawingRecorder. Created 4 years, 9 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 202a06ec3a544304f8479de75e868293d11291c7..2fc78331f63336a6961f9a5b54c09a5abe670af5 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp
@@ -88,9 +88,13 @@ DrawingRecorder::~DrawingRecorder()
ASSERT(m_displayItemPosition == m_context.getPaintController().newDisplayItemList().size());
#endif
+ RefPtr<const SkPicture> recording = m_context.endRecording();
+ if (!recording)
+ return;
+
m_context.getPaintController().createAndAppend<DrawingDisplayItem>(m_displayItemClient
, m_displayItemType
- , m_context.endRecording()
+ , recording
, m_knownToBeOpaque
#if ENABLE(ASSERT)
, m_underInvalidationCheckingMode

Powered by Google App Engine
This is Rietveld 408576698