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

Unified Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.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/core/svg/graphics/SVGImage.cpp
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
index 2d0f17b8994daac736bb8b2f0fb375b97b684e9a..dbbea4e2558185582be737b27f3531a8bebf4bdb 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -287,6 +287,8 @@ void SVGImage::drawPatternForContainer(GraphicsContext& context, const FloatSize
drawForContainer(patternPicture.context().canvas(), paint, containerSize, zoom, tile, srcRect, url);
}
RefPtr<SkPicture> tilePicture = patternPicture.endRecording();
+ if (!tilePicture)
+ return;
SkMatrix patternTransform;
patternTransform.setTranslate(phase.x() + spacedTile.x(), phase.y() + spacedTile.y());
@@ -370,7 +372,8 @@ void SVGImage::drawInternal(SkCanvas* canvas, const SkPaint& paint, const FloatR
canvas->saveLayer(&layerRect, &paint);
}
RefPtr<const SkPicture> recording = imagePicture.endRecording();
- canvas->drawPicture(recording.get());
+ if (recording)
+ canvas->drawPicture(recording.get());
}
if (getImageObserver())

Powered by Google App Engine
This is Rietveld 408576698