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

Unified Diff: tools/debugger/SkDrawCommand.cpp

Issue 2333713002: change SkStreams to work with sk_sp<SkData> instead of SkData* (Closed)
Patch Set: Created 4 years, 3 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: tools/debugger/SkDrawCommand.cpp
diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp
index d77a554fa403d4a188e9b0cf9ebd19d19988d483..45f048e510cebd053ebe54a3ca30c031c98e9242 100644
--- a/tools/debugger/SkDrawCommand.cpp
+++ b/tools/debugger/SkDrawCommand.cpp
@@ -707,11 +707,10 @@ bool SkDrawCommand::flatten(const SkImage& image, Json::Value* target,
SkDynamicMemoryWStream out;
SkDrawCommand::WritePNG((const png_bytep) encodedBitmap->bytes(), image.width(), image.height(),
out, false);
- SkData* encoded = out.copyToData();
+ sk_sp<SkData> encoded = out.makeCopy();
Json::Value jsonData;
encode_data(encoded->data(), encoded->size(), "image/png", urlDataManager, &jsonData);
(*target)[SKDEBUGCANVAS_ATTRIBUTE_DATA] = jsonData;
- encoded->unref();
return true;
}

Powered by Google App Engine
This is Rietveld 408576698