Revert "Revert "Change image encode api to return sk_sp""
This reverts commit 64778d9f275d8ce3df8f4ab39ff334b7ef5b70d3.
Bug: skia:
Change-Id: I779515ff1e16a40c33890a4bac7a8a07171aadfe
Reviewed-on: https://skia-review.googlesource.com/22261
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/c/sk_surface.cpp b/src/c/sk_surface.cpp
index 7e1fb3d..a77f61e 100644
--- a/src/c/sk_surface.cpp
+++ b/src/c/sk_surface.cpp
@@ -233,7 +233,7 @@
}
sk_data_t* sk_image_encode(const sk_image_t* cimage) {
- return ToData(AsImage(cimage)->encode());
+ return ToData(AsImage(cimage)->encodeToData().release());
}
void sk_image_ref(const sk_image_t* cimage) {