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

Unified Diff: include/core/SkDevice.h

Issue 1162203005: clarify that accessPixels is for write-access, and peekPixels is RO (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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/SkBitmapDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkDevice.h
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index c23b2973ee27eadc4f79619817aa7898543bb501..de43d1e8b88fd5c6acfd6613299e753425930652 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -82,9 +82,24 @@ public:
bool writePixels(const SkImageInfo&, const void*, size_t rowBytes, int x, int y);
+ /**
+ * Try to get write-access to the pixels behind the device. If successful, this returns true
+ * and fills-out the pixmap parameter. On success it also bumps the genID of the underlying
+ * bitmap.
+ *
+ * On failure, returns false and ignores the pixmap parameter.
+ */
bool accessPixels(SkPixmap* pmap);
/**
+ * Try to get read-only-access to the pixels behind the device. If successful, this returns
+ * true and fills-out the pixmap parameter.
+ *
+ * On failure, returns false and ignores the pixmap parameter.
+ */
+ bool peekPixels(SkPixmap*);
+
+ /**
* Return the device's associated gpu render target, or NULL.
*/
virtual GrRenderTarget* accessRenderTarget() { return NULL; }
@@ -241,7 +256,6 @@ protected:
const SkMatrix*, const SkPaint&);
bool readPixels(const SkImageInfo&, void* dst, size_t rowBytes, int x, int y);
- bool peekPixels(SkPixmap*);
///////////////////////////////////////////////////////////////////////////
« no previous file with comments | « no previous file | src/core/SkBitmapDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698