From: Matthew Leibowitz Date: Sun, 6 May 2018 00:52:01 +0000 (+0200) Subject: Exposing the SkBitmap::swap method as this is used. X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ceff8e6562f6909837741b7798cd8727c10cf8e6;p=platform%2Fupstream%2FlibSkiaSharp.git Exposing the SkBitmap::swap method as this is used. - most notably in the now-removed copyTo method --- diff --git a/include/c/sk_bitmap.h b/include/c/sk_bitmap.h index 5934b57..c4f3635 100644 --- a/include/c/sk_bitmap.h +++ b/include/c/sk_bitmap.h @@ -50,6 +50,7 @@ SK_C_API bool sk_bitmap_peek_pixels(sk_bitmap_t* cbitmap, sk_pixmap_t* cpixmap); SK_C_API bool sk_bitmap_extract_subset(sk_bitmap_t* cbitmap, sk_bitmap_t* dst, sk_irect_t* subset); SK_C_API bool sk_bitmap_extract_alpha(sk_bitmap_t* cbitmap, sk_bitmap_t* dst, const sk_paint_t* paint, sk_ipoint_t* offset); SK_C_API void sk_bitmap_notify_pixels_changed(sk_bitmap_t* cbitmap); +SK_C_API void sk_bitmap_swap(sk_bitmap_t* cbitmap, sk_bitmap_t* cother); SK_C_PLUS_PLUS_END_GUARD diff --git a/src/c/sk_bitmap.cpp b/src/c/sk_bitmap.cpp index 4cf7654..1291600 100644 --- a/src/c/sk_bitmap.cpp +++ b/src/c/sk_bitmap.cpp @@ -366,3 +366,8 @@ void sk_bitmap_notify_pixels_changed(sk_bitmap_t* cbitmap) { AsBitmap(cbitmap)->notifyPixelsChanged(); } + +void sk_bitmap_swap(sk_bitmap_t* cbitmap, sk_bitmap_t* cother) +{ + AsBitmap(cbitmap)->swap(AsBitmap(*cother)); +} diff --git a/src/c/sk_types_priv.h b/src/c/sk_types_priv.h index cb8a302..dd34545 100644 --- a/src/c/sk_types_priv.h +++ b/src/c/sk_types_priv.h @@ -143,6 +143,10 @@ static inline SkBitmap* AsBitmap(sk_bitmap_t* cbitmap) { return reinterpret_cast(cbitmap); } +static inline SkBitmap& AsBitmap(sk_bitmap_t& cbitmap) { + return reinterpret_cast(cbitmap); +} + static inline const SkPixmap* AsPixmap(const sk_pixmap_t* cpixmap) { return reinterpret_cast(cpixmap); }