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

Unified Diff: third_party/WebKit/Source/core/paint/SVGClipPainter.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/paint/SVGClipPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/SVGClipPainter.cpp b/third_party/WebKit/Source/core/paint/SVGClipPainter.cpp
index 806cad631f9bcec3e41a5356a486cf659604acad..e36ea76bf463a69dd852c98fd12055bf26b61a9f 100644
--- a/third_party/WebKit/Source/core/paint/SVGClipPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGClipPainter.cpp
@@ -127,7 +127,8 @@ bool SVGClipPainter::drawClipAsMask(GraphicsContext& context, const LayoutObject
TransformRecorder contentTransformRecorder(maskContext, layoutObject, contentTransform);
RefPtr<const SkPicture> clipContentPicture = m_clip.createContentPicture();
- maskContext.getPaintController().createAndAppend<DrawingDisplayItem>(layoutObject, DisplayItem::SVGClip, clipContentPicture.get());
+ if (clipContentPicture)
+ maskContext.getPaintController().createAndAppend<DrawingDisplayItem>(layoutObject, DisplayItem::SVGClip, clipContentPicture.get());
}
if (clipPathClipper)
@@ -136,7 +137,8 @@ bool SVGClipPainter::drawClipAsMask(GraphicsContext& context, const LayoutObject
LayoutObjectDrawingRecorder drawingRecorder(context, layoutObject, DisplayItem::SVGClip, targetPaintInvalidationRect);
RefPtr<SkPicture> maskPicture = maskPictureBuilder.endRecording();
- context.drawPicture(maskPicture.get());
+ if (maskPicture)
+ context.drawPicture(maskPicture.get());
return true;
}

Powered by Google App Engine
This is Rietveld 408576698