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

Unified Diff: include/gpu/GrDrawContext.h

Issue 2298253002: Add read/write-Pixels to GrDrawContext (Closed)
Patch Set: Created 4 years, 4 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/gpu/GrDrawContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrDrawContext.h
diff --git a/include/gpu/GrDrawContext.h b/include/gpu/GrDrawContext.h
index 29c7d1c12e4701136b55ef19d757b6ee8ae2b2f9..ba57a2333606908d2237156456fe047cfdb773c1 100644
--- a/include/gpu/GrDrawContext.h
+++ b/include/gpu/GrDrawContext.h
@@ -284,6 +284,34 @@ public:
*/
void prepareForExternalIO();
+ /**
+ * Reads a rectangle of pixels from the draw context.
+ * @param dstInfo image info for the destination
+ * @param dstBuffer destination pixels for the read
+ * @param dstRowBytes bytes in a row of 'dstBuffer'
+ * @param x x offset w/in the draw context from which to read
+ * @param y y offset w/in the draw context from which to read
+ *
+ * @return true if the read succeeded, false if not. The read can fail because of an
+ * unsupported pixel config.
+ */
+ bool readPixels(const SkImageInfo& dstInfo, void* dstBuffer, size_t dstRowBytes, int x, int y);
+
+ /**
+ * Writes a rectangle of pixels [srcInfo, srcBuffer, srcRowbytes] into the
+ * drawContext at the specified position.
+ * @param srcInfo image info for the source pixels
+ * @param srcBuffer source for the write
+ * @param srcRowBytes bytes in a row of 'srcBuffer'
+ * @param x x offset w/in the draw context at which to write
+ * @param y y offset w/in the draw context at which to write
+ *
+ * @return true if the write succeeded, false if not. The write can fail because of an
+ * unsupported pixel config.
+ */
+ bool writePixels(const SkImageInfo& srcInfo, const void* srcBuffer, size_t srcRowBytes,
+ int x, int y);
+
bool isStencilBufferMultisampled() const {
return fRenderTarget->isStencilBufferMultisampled();
}
« no previous file with comments | « no previous file | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698