aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/utils
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-01-03 13:48:50 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-01-03 13:48:50 +0000
commit38669c12c5ab784d5ad94eb2b26b89becac2ba12 (patch)
tree2a071ed819cf73e24dc5044d1c46e1e3e811744a /include/utils
parent832806cf8ee1d623be343e55f26d59894f4bae6c (diff)
add colorspace option to SkBitmap -> CGImageRef utility (patch from nico)
git-svn-id: http://skia.googlecode.com/svn/trunk@666 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/utils')
-rw-r--r--include/utils/mac/SkCGUtils.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/utils/mac/SkCGUtils.h b/include/utils/mac/SkCGUtils.h
index b1263f432f..8a8a1ed9f3 100644
--- a/include/utils/mac/SkCGUtils.h
+++ b/include/utils/mac/SkCGUtils.h
@@ -11,8 +11,25 @@
class SkBitmap;
-CGImageRef SkCreateCGImageRef(const SkBitmap&);
+/**
+ * Create an imageref from the specified bitmap using the specified colorspace.
+ */
+CGImageRef SkCreateCGImageRefWithColorspace(const SkBitmap& bm,
+ CGColorSpaceRef space);
+/**
+ * Create an imageref from the specified bitmap using the colorspace
+ * kCGColorSpaceGenericRGB
+ */
+CGImageRef SkCreateCGImageRef(const SkBitmap& bm) {
+ return SkCreateCGImageRefWithColorspace(bm, NULL);
+}
+
+/**
+ * Draw the bitmap into the specified CG context. The bitmap will be converted
+ * to a CGImage using the generic RGB colorspace. (x,y) specifies the position
+ * of the top-left corner of the bitmap.
+ */
void SkCGDrawBitmap(CGContextRef, const SkBitmap&, float x, float y);
#endif