Chromium Code Reviews| Index: include/utils/mac/SkCGUtils.h |
| diff --git a/include/utils/mac/SkCGUtils.h b/include/utils/mac/SkCGUtils.h |
| index 54c858c1ae4d24aa4f217677ff268977a4ffbe2e..55d0458489b7c1ec52cede031593e2cfe156c169 100644 |
| --- a/include/utils/mac/SkCGUtils.h |
| +++ b/include/utils/mac/SkCGUtils.h |
| @@ -8,7 +8,8 @@ |
| #ifndef SkCGUtils_DEFINED |
| #define SkCGUtils_DEFINED |
| -#include "SkTypes.h" |
| +#include "SkSize.h" |
| +#include "SkImageInfo.h" |
| #ifdef SK_BUILD_FOR_MAC |
| #include <ApplicationServices/ApplicationServices.h> |
| @@ -23,6 +24,25 @@ class SkData; |
| class SkStream; |
| /** |
| + * Given a CGImage, allocate a SkBitmap and copy the images's pixels into it. If scaleToFit is not |
|
scroggo
2014/04/21 20:18:44
nit: an SkBitmap
nit: image's
reed1
2014/04/21 20:44:41
Done.
|
| + * null, use it to determine the size of the bitmap, and scale the image to fill the bitmap. |
| + * Otherwise use the image's width/height. |
| + * |
| + * On failure, return false, and leave bitmap unchanged. |
| + */ |
| +SK_API bool SkCreateBitmapFromCGImage(SkBitmap* dst, CGImageRef src, SkISize* scaleToFit = NULL); |
|
scroggo
2014/04/21 20:18:44
This version is unused. Does Chrome want it?
reed1
2014/04/21 20:44:41
Yes, this is explicit added for chrome!
|
| + |
| +/** |
| + * Given a CGImage, allocate a SkBitmap and copy the images's pixels into it. If scaleToFit is not |
|
hal.canary
2014/04/21 20:15:51
that's now what this does.
scroggo
2014/04/21 20:18:44
This comment describes the other function, not thi
reed1
2014/04/21 20:44:41
You caught me copy-pasting. Done.
|
| + * null, use it to determine the size of the bitmap, and scale the image to fill the bitmap. |
| + * Otherwise use the image's width/height. |
| + * |
| + * On failure, return false, and leave bitmap unchanged. |
| + */ |
| +SK_API bool SkCopyPixelsFromCGImage(const SkImageInfo& info, size_t rowBytes, void* pixels, |
| + CGImageRef src); |
| + |
| +/** |
| * Create an imageref from the specified bitmap using the specified colorspace. |
| * If space is NULL, then CGColorSpaceCreateDeviceRGB() is used. |
| */ |