aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/utils
diff options
context:
space:
mode:
Diffstat (limited to 'include/utils')
-rw-r--r--include/utils/mac/SkCGUtils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/utils/mac/SkCGUtils.h b/include/utils/mac/SkCGUtils.h
index 2dcbb965b4..06995c3ec1 100644
--- a/include/utils/mac/SkCGUtils.h
+++ b/include/utils/mac/SkCGUtils.h
@@ -11,6 +11,7 @@
#include "SkSize.h"
#include "SkImageInfo.h"
#include "SkImage.h"
+#include "SkPixmap.h"
#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
@@ -46,6 +47,9 @@ SK_API sk_sp<SkImage> SkMakeImageFromCGImage(CGImageRef);
*/
SK_API bool SkCopyPixelsFromCGImage(const SkImageInfo& info, size_t rowBytes, void* dstPixels,
CGImageRef src);
+static inline bool SkCopyPixelsFromCGImage(const SkPixmap& dst, CGImageRef src) {
+ return SkCopyPixelsFromCGImage(dst.info(), dst.rowBytes(), dst.writable_addr(), src);
+}
/**
* Create an imageref from the specified bitmap using the specified colorspace.