aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/fiddle
diff options
context:
space:
mode:
Diffstat (limited to 'tools/fiddle')
-rw-r--r--tools/fiddle/fiddle_main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/fiddle/fiddle_main.cpp b/tools/fiddle/fiddle_main.cpp
index 74aefb8bbb..6ceffc9b9c 100644
--- a/tools/fiddle/fiddle_main.cpp
+++ b/tools/fiddle/fiddle_main.cpp
@@ -88,9 +88,9 @@ static void dump_output(const sk_sp<SkData>& data,
}
}
-static SkData* encode_snapshot(const sk_sp<SkSurface>& surface) {
+static sk_sp<SkData> encode_snapshot(const sk_sp<SkSurface>& surface) {
sk_sp<SkImage> img(surface->makeImageSnapshot());
- return img ? img->encode() : nullptr;
+ return img ? img->encodeToData() : nullptr;
}
static SkCanvas* prepare_canvas(SkCanvas * canvas) {
@@ -142,7 +142,7 @@ int main(int argc, char** argv) {
auto rasterSurface = SkSurface::MakeRaster(info);
srand(0);
draw(prepare_canvas(rasterSurface->getCanvas()));
- rasterData.reset(encode_snapshot(rasterSurface));
+ rasterData = encode_snapshot(rasterSurface);
}
if (options.gpu) {
auto grContext = create_grcontext(gGLDriverInfo);
@@ -156,7 +156,7 @@ int main(int argc, char** argv) {
}
srand(0);
draw(prepare_canvas(surface->getCanvas()));
- gpuData.reset(encode_snapshot(surface));
+ gpuData = encode_snapshot(surface);
}
}
if (options.pdf) {