aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/fiddle
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-07-11 11:20:21 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-11 15:43:21 +0000
commitdc799550e2d9965aa5b7cda496465b2a76b310a5 (patch)
tree9f5f2a1c9da5bbeab2363bae6bd8cd933019dfc3 /tools/fiddle
parentf02fa6ffe72c596b87e277193ed82d288dbee18f (diff)
Change image encode api to return sk_sp
Bug: skia: Change-Id: I238289bc630be27795cb1384955dd6e887597c05 Reviewed-on: https://skia-review.googlesource.com/22208 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
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) {