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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/SkPictureBuilder.h

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/SkPictureBuilder.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/SkPictureBuilder.h b/third_party/WebKit/Source/platform/graphics/paint/SkPictureBuilder.h
index b2f70539fe0e05d08d4ba0503e597241dfa79f98..beb48ec02223c9b6f2133f4d208969c1b76c74d7 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/SkPictureBuilder.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/SkPictureBuilder.h
@@ -19,6 +19,10 @@ namespace blink {
class SkPictureBuilder final {
WTF_MAKE_NONCOPYABLE(SkPictureBuilder);
public:
+ // Constructs a new builder with the given bounds for the resulting recorded picture. If
+ // |metadata| is specified, that metadata is propagated to the builder's internal canvas. If
+ // |containingContext| is specified, the device scale factor, printing, and disabled state are
+ // propagated to the builder's internal context.
SkPictureBuilder(const FloatRect& bounds, SkMetaData* metaData = nullptr, GraphicsContext* containingContext = nullptr)
: m_bounds(bounds)
{
@@ -38,6 +42,8 @@ public:
GraphicsContext& context() { return *m_context; }
+ // Returns a picture capturing all drawing performed on the builder's context since
+ // construction, or nullptr if the picture could not be created.
PassRefPtr<SkPicture> endRecording()
{
m_context->beginRecording(m_bounds);

Powered by Google App Engine
This is Rietveld 408576698