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

Unified Diff: include/core/SkPixmap.h

Issue 1662353002: Add SkAutoPixmapStorage::detachPixelsAsData() (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: detachPixelsAsData Created 4 years, 10 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/SkPixmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPixmap.h
diff --git a/include/core/SkPixmap.h b/include/core/SkPixmap.h
index da97025cab03ae032dd3a7750607143c3fe5e9b9..523c40f294db0b1e5c69b234748dcd4f3340bdab 100644
--- a/include/core/SkPixmap.h
+++ b/include/core/SkPixmap.h
@@ -13,6 +13,7 @@
#include "SkImageInfo.h"
class SkColorTable;
+class SkData;
struct SkMask;
/**
@@ -184,6 +185,12 @@ public:
*/
void alloc(const SkImageInfo&);
+ /**
+ * Returns an SkData object wrapping the allocated pixels memory, and resets the pixmap.
+ * If the storage hasn't been allocated, the result is NULL.
+ */
+ const SkData* SK_WARN_UNUSED_RESULT detachPixelsAsData();
+
// We wrap these so we can clear our internal storage
void reset() {
@@ -208,7 +215,7 @@ private:
void freeStorage() {
sk_free(fStorage);
- fStorage = NULL;
+ fStorage = nullptr;
}
typedef SkPixmap INHERITED;
« no previous file with comments | « no previous file | src/core/SkPixmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698