Index: tools/debugger/SkDrawCommand.cpp |
diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp |
index d77a554fa403d4a188e9b0cf9ebd19d19988d483..6ca3fe074e580a9d84102d0a2f775123393ac590 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.detachAsData(); |
Json::Value jsonData; |
encode_data(encoded->data(), encoded->size(), "image/png", urlDataManager, &jsonData); |
(*target)[SKDEBUGCANVAS_ATTRIBUTE_DATA] = jsonData; |
- encoded->unref(); |
return true; |
} |