Index: include/core/SkBitmap.h |
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h |
index f53a0a7e45a4d98a7eed2104027794cd33029dfc..4732591e9246524ad58a8c9dc3f7fbd3d7f31ecd 100644 |
--- a/include/core/SkBitmap.h |
+++ b/include/core/SkBitmap.h |
@@ -248,7 +248,25 @@ public: |
} |
bool setConfig(const SkImageInfo& info, size_t rowBytes = 0); |
- |
+ |
+ /** |
+ * Allocate a pixelref to match the specified image info, using the default |
+ * allocator, computing a minimum rowBytes based on info. |
+ * On failure, the bitmap will be set to empty and return false. |
+ */ |
+ bool allocPixels(const SkImageInfo&, SkColorTable* ctable = NULL); |
scroggo
2014/01/23 21:53:02
I assume these are to replace the existing setConf
hal.canary
2014/01/23 22:05:24
Why not:
bool allocPixels(const SkImageInfo&,
reed1
2014/01/24 14:54:48
Done.
|
+ |
+ /** |
+ * 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 |
+ * pixels and context as parameters. |
+ * On failure, the bitmap will be set to empty and return false. |
+ */ |
+ bool installPixels(const SkImageInfo&, void* pixels, size_t rowBytes, |
+ void (*ReleaseProc)(void* addr, void* context), |
+ void* context); |
+ |
/** |
* If the bitmap's config can be represented as SkImageInfo, return true, |
* and if info is not-null, set it to the bitmap's info. If it cannot be |