aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkBitmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/core/SkBitmap.h')
-rw-r--r--include/core/SkBitmap.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index 5d6e3ba55b..4dcf327226 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -269,6 +269,20 @@ public:
}
/**
+ * Legacy helper function, which creates an SkImageInfo from the specified
+ * config and then calls allocPixels(info).
+ */
+ bool allocConfigPixels(Config, int width, int height, bool isOpaque = false);
+
+ bool allocN32Pixels(int width, int height, bool isOpaque = false) {
+ SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
+ if (isOpaque) {
+ info.fAlphaType = kOpaque_SkAlphaType;
+ }
+ return this->allocPixels(info);
+ }
+
+ /**
* Install a pixelref that wraps the specified pixels and rowBytes, and
* optional ReleaseProc and context. When the pixels are no longer
* referenced, if ReleaseProc is not null, it will be called with the