Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: include/core/SkBitmap.h

Issue 143073008: add installPixels (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: sample impl Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkBitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | src/core/SkBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698