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

Unified Diff: src/gpu/GrGpu.h

Issue 1262473004: Make GrGpu read/write pixels take GrSurface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 5 years, 5 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 | « src/gpu/GrContext.cpp ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »
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 8bb676d77994f8d1a1417f3c3d272f628ebea9aa..e6f37cc1cfc881e9350444b23071bc202acd8fe0 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -210,8 +210,7 @@ public:
/**
* Reads a rectangle of pixels from a render target.
*
- * @param renderTarget the render target to read from. NULL means the
- * current render target.
+ * @param surface The surface to read from
* @param left left edge of the rectangle to read (inclusive)
* @param top top edge of the rectangle to read (inclusive)
* @param width width of rectangle to read in pixels.
@@ -227,13 +226,14 @@ public:
* because of a unsupported pixel config or because no render
* target is currently set.
*/
- bool readPixels(GrRenderTarget* renderTarget,
+ bool readPixels(GrSurface* surface,
int left, int top, int width, int height,
GrPixelConfig config, void* buffer, size_t rowBytes);
/**
- * Updates the pixels in a rectangle of a texture.
+ * Updates the pixels in a rectangle of a surface.
*
+ * @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.
@@ -243,10 +243,10 @@ public:
* @param rowBytes number of bytes between consecutive rows. Zero
* means rows are tightly packed.
*/
- bool writeTexturePixels(GrTexture* texture,
- int left, int top, int width, int height,
- GrPixelConfig config, const void* buffer,
- size_t rowBytes);
+ bool writePixels(GrSurface* surface,
+ int left, int top, int width, int height,
+ GrPixelConfig config, const void* buffer,
+ size_t rowBytes);
/**
* Clear the passed in render target. Ignores the draw state and clip. Clears the whole thing if
@@ -468,17 +468,18 @@ private:
GrPixelConfig srcConfig, DrawPreference*,
WritePixelTempDrawInfo*) = 0;
- virtual bool onReadPixels(GrRenderTarget* target,
+ // overridden by backend-specific derived class to perform the surface read
+ virtual bool onReadPixels(GrSurface*,
int left, int top, int width, int height,
GrPixelConfig,
void* buffer,
size_t rowBytes) = 0;
- // overridden by backend-specific derived class to perform the texture update
- virtual bool onWriteTexturePixels(GrTexture* texture,
- int left, int top, int width, int height,
- GrPixelConfig config, const void* buffer,
- size_t rowBytes) = 0;
+ // overridden by backend-specific derived class to perform the surface write
+ virtual bool onWritePixels(GrSurface*,
+ int left, int top, int width, int height,
+ GrPixelConfig config, const void* buffer,
+ 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 | « src/gpu/GrContext.cpp ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698