[C API] Add sk_image_new_from_bitmap
authorMiguel de Icaza <miguel@gnome.org>
Sat, 9 Jul 2016 02:46:53 +0000 (22:46 -0400)
committerMiguel de Icaza <miguel@gnome.org>
Sat, 9 Jul 2016 02:46:53 +0000 (22:46 -0400)
include/c/xamarin/sk_x_image.h
src/c/xamarin/sk_x_image.cpp

index 8adf3682dabec39c257f5f331830d1d08997ea09..29c3064639f19c3390bfad1c509fc8e5db4a2dfe 100644 (file)
@@ -26,6 +26,8 @@ SK_C_PLUS_PLUS_BEGIN_GUARD
  */
 SK_API sk_data_t* sk_image_encode_specific(const sk_image_t* cimage, sk_image_encoder_t encoder, int quality);
 
+SK_API sk_image_t* sk_image_new_from_bitmap (const sk_bitmap_t *cbitmap);
+
 SK_C_PLUS_PLUS_END_GUARD
 
 #endif
index 2e7f8099d1285b6936689f7e0649f4f5daf81bb1..bc849b56886ed4809f56bade550b3745a02755c9 100644 (file)
@@ -19,3 +19,8 @@ sk_data_t* sk_image_encode_specific(const sk_image_t* cimage, sk_image_encoder_t
     }
     return ToData(AsImage(cimage)->encode(t, quality));
 }
+
+sk_image_t* sk_image_new_from_bitmap (const sk_bitmap_t* cbitmap)
+{
+       return (sk_image_t*) SkImage::NewFromBitmap (*AsBitmap(cbitmap));
+}