Index: include/core/SkBitmap.h |
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h |
index af0c8b87e7a643fbf7fbf7b193fcb53b8ffcf010..8059e262f3d4c7d13abf864f52826ae80578fc28 100644 |
--- a/include/core/SkBitmap.h |
+++ b/include/core/SkBitmap.h |
@@ -267,7 +267,21 @@ public: |
bool allocPixels(const SkImageInfo& info) { |
return this->allocPixels(info, NULL, NULL); |
} |
- |
+ |
+ /** |
+ * 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 |