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/SkCanvas.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 | « gm/blend.cpp ('k') | include/core/SkImage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 1b4571a09c9c65b9b3fdcfde71431636a1d39736..034e405f3d623a2bb57457812b19b11fe4874f27 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -212,16 +212,19 @@ public:
/**
* If the canvas has readable pixels in its base layer (and is not recording to a picture
* or other non-raster target) and 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
+ * local RAM) return true, and if not null, return in the pixmap parameter information about
+ * the pixels. The pixmap's pixel address is only valid
* while the canvas object is in scope and unchanged. Any API calls made on
- * canvas (or its parent surface if any) will invalidate the
- * returned address (and associated information).
+ * canvas (or its parent surface if any) will invalidate the pixel address
+ * (and associated information).
*
- * On failure, returns NULL and the info and rowBytes parameters are
- * ignored.
+ * On failure, returns false and the pixmap parameter will be ignored.
*/
+ bool peekPixels(SkPixmap*);
+
+#ifdef SK_SUPPORT_LEGACY_PEEKPIXELS_PARMS
const void* peekPixels(SkImageInfo* info, size_t* rowBytes);
+#endif
/**
* Copy the pixels from the base-layer into the specified buffer (pixels + rowBytes),
« no previous file with comments | « gm/blend.cpp ('k') | include/core/SkImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698