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

Unified Diff: src/gpu/GrGpu.h

Issue 1534123003: More framework support for TransferBuffers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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/GrGpu.cpp » ('j') | src/gpu/GrGpu.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpu.h
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index d1b0802721e97e8005f3491238da1c295eeb429e..f07bf03b13ebb3a1aad5b8f68cffa6a79aea525e 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -266,6 +266,25 @@ public:
size_t rowBytes);
/**
+ * Updates the pixels in a rectangle of a surface using a GrTransferBuffer
+ *
+ * @param surface The surface to write to.
+ * @param left left edge of the rectangle to write (inclusive)
+ * @param top top edge of the rectangle to write (inclusive)
+ * @param width width of rectangle to write in pixels.
+ * @param height height of rectangle to write in pixels.
+ * @param config the pixel config of the source buffer
+ * @param buffer GrTransferBuffer to read pixels from
+ * @param offset offset from the start of the buffer
+ * @param rowBytes number of bytes between consecutive rows. Zero
+ * means rows are tightly packed.
+ */
+ bool transferPixels(GrSurface* surface,
+ int left, int top, int width, int height,
+ GrPixelConfig config, GrTransferBuffer* buffer,
+ size_t offset, size_t rowBytes);
+
+ /**
* Clear the passed in render target. Ignores the draw state and clip.
*/
void clear(const SkIRect& rect, GrColor color, GrRenderTarget* renderTarget);
@@ -508,6 +527,12 @@ private:
GrPixelConfig config, const void* buffer,
size_t rowBytes) = 0;
+ // overridden by backend-specific derived class to perform the surface write
+ virtual bool onTransferPixels(GrSurface*,
+ int left, int top, int width, int height,
+ GrPixelConfig config, GrTransferBuffer* buffer,
+ size_t offset, size_t rowBytes) = 0;
+
// overridden by backend-specific derived class to perform the resolve
virtual void onResolveRenderTarget(GrRenderTarget* target) = 0;
« no previous file with comments | « no previous file | src/gpu/GrGpu.cpp » ('j') | src/gpu/GrGpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698