From 176bd71755347e14ff59f3fe6fe125af800c3c8e Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Thu, 8 Feb 2018 15:02:55 +0200 Subject: [PATCH] Added SkImage::isLazyGenerated() to the C API --- include/c/sk_image.h | 1 + src/c/sk_image.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/c/sk_image.h b/include/c/sk_image.h index 8408752..9a8afb6 100644 --- a/include/c/sk_image.h +++ b/include/c/sk_image.h @@ -35,6 +35,7 @@ SK_C_API bool sk_image_is_alpha_only(const sk_image_t*); SK_C_API sk_shader_t* sk_image_make_shader(const sk_image_t*, sk_shader_tilemode_t tileX, sk_shader_tilemode_t tileY, const sk_matrix_t* localMatrix); SK_C_API bool sk_image_peek_pixels(const sk_image_t* image, sk_pixmap_t* pixmap); SK_C_API bool sk_image_is_texture_backed(const sk_image_t* image); +SK_C_API bool sk_image_is_lazy_generated(const sk_image_t* image); SK_C_API bool sk_image_read_pixels(const sk_image_t* image, const sk_imageinfo_t* dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, sk_image_caching_hint_t cachingHint); SK_C_API bool sk_image_read_pixels_into_pixmap(const sk_image_t* image, const sk_pixmap_t* dst, int srcX, int srcY, sk_image_caching_hint_t cachingHint); SK_C_API bool sk_image_scale_pixels(const sk_image_t* image, const sk_pixmap_t* dst, sk_filter_quality_t quality, sk_image_caching_hint_t cachingHint); diff --git a/src/c/sk_image.cpp b/src/c/sk_image.cpp index fb5b662..15eda36 100644 --- a/src/c/sk_image.cpp +++ b/src/c/sk_image.cpp @@ -110,6 +110,10 @@ bool sk_image_is_texture_backed(const sk_image_t* image) { return AsImage(image)->isTextureBacked(); } +bool sk_image_is_lazy_generated(const sk_image_t* image) { + return AsImage(image)->isLazyGenerated(); +} + bool sk_image_read_pixels(const sk_image_t* image, const sk_imageinfo_t* dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, sk_image_caching_hint_t cachingHint) { SkImageInfo info; from_c(*dstInfo, &info); -- 2.7.4