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

Unified Diff: src/c/sk_surface.cpp

Issue 1778393002: add Make variations to return SkImage by sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: roll in fmalitas comments Created 4 years, 9 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: src/c/sk_surface.cpp
diff --git a/src/c/sk_surface.cpp b/src/c/sk_surface.cpp
index f7fa30f28a48c4027e86379dc668c97d617ef2fa..6bd62a9aa9f29f47a04ddc6ea7ce46b8607af330 100644
--- a/src/c/sk_surface.cpp
+++ b/src/c/sk_surface.cpp
@@ -224,12 +224,12 @@ sk_image_t* sk_image_new_raster_copy(const sk_imageinfo_t* cinfo, const void* pi
if (!from_c_info(*cinfo, &info)) {
return NULL;
}
- return (sk_image_t*)SkImage::NewRasterCopy(info, pixels, rowBytes);
+ return (sk_image_t*)SkImage::MakeRasterCopy(SkPixmap(info, pixels, rowBytes)).release();
}
sk_image_t* sk_image_new_from_encoded(const sk_data_t* cdata, const sk_irect_t* subset) {
- return ToImage(SkImage::NewFromEncoded(AsData(cdata),
- reinterpret_cast<const SkIRect*>(subset)));
+ return ToImage(SkImage::MakeFromEncoded(sk_ref_sp(AsData(cdata)),
+ reinterpret_cast<const SkIRect*>(subset)).release());
}
sk_data_t* sk_image_encode(const sk_image_t* cimage) {
« no previous file with comments | « include/core/SkShader.h ('k') | src/core/SkPictureShader.h » ('j') | src/image/SkImage.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698