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

Unified Diff: include/core/SkImage.h

Issue 1784563002: unify peekPixels around pixmap parameter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update GrUploadPixmapToTexture to know about the new desc if readPixels was called Created 4 years, 9 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 | « include/core/SkCanvas.h ('k') | include/core/SkSurface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImage.h
diff --git a/include/core/SkImage.h b/include/core/SkImage.h
index 0474195ae2f1ad2d69bf9494f1111afff570eb7f..c920c54016aa2a270445f442c9470c32d6070837 100644
--- a/include/core/SkImage.h
+++ b/include/core/SkImage.h
@@ -168,6 +168,16 @@ public:
const SkMatrix* localMatrix = NULL) const;
/**
+ * If the image has direct access to its pixels (i.e. they are in local RAM)
+ * return true, and if not null, return in the pixmap parameter the info about the
+ * images pixels.
+ *
+ * On failure, return false and ignore the pixmap parameter.
+ */
+ bool peekPixels(SkPixmap* pixmap) const;
+
+#ifdef SK_SUPPORT_LEGACY_PEEKPIXELS_PARMS
+ /**
* If the image has direct access to its pixels (i.e. they are in local
* RAM) return the (const) address of those pixels, and if not null, return
* the ImageInfo and rowBytes. The returned address is only valid while
@@ -175,17 +185,11 @@ public:
*
* On failure, returns NULL and the info and rowBytes parameters are
* ignored.
- */
- const void* peekPixels(SkImageInfo* info, size_t* rowBytes) const;
-
- /**
- * If the image has direct access to its pixels (i.e. they are in local
- * RAM) return the (const) address of those pixels, and if not null, return
- * true, and if pixmap is not NULL, set it to point into the image.
*
- * On failure, return false and ignore the pixmap parameter.
+ * DEPRECATED -- use the SkPixmap variant instead
*/
- bool peekPixels(SkPixmap* pixmap) const;
+ const void* peekPixels(SkImageInfo* info, size_t* rowBytes) const;
+#endif
/**
* Some images have to perform preliminary work in preparation for drawing. This can be
« no previous file with comments | « include/core/SkCanvas.h ('k') | include/core/SkSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698