aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-06-01 15:04:28 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-02 00:00:56 +0000
commita9b04b90669e08c1ee4aa826a83c416b24704248 (patch)
tree01fd326b461a8d2065c0cd70f367dba0806318ba /src/gpu/GrGpu.h
parent257c1fb7524db283f43ac3d3813e917cbe522e81 (diff)
Remove origin from GrGpu::writePixels
Change-Id: Iea3d68d282420f28623ebea315499fbd7ad9d471 Reviewed-on: https://skia-review.googlesource.com/131526 Commit-Queue: Brian Salomon <bsalomon@google.com> Auto-Submit: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrGpu.h')
-rw-r--r--src/gpu/GrGpu.h24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 6adabf46d1..6958ea997f 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -184,25 +184,16 @@ public:
* @param texels array of mipmap levels containing texture data
* @param mipLevelCount number of levels in 'texels'
*/
- bool writePixels(GrSurface* surface, GrSurfaceOrigin origin, int left, int top, int width,
- int height, GrColorType srcColorType, const GrMipLevel texels[],
- int mipLevelCount);
-
- /**
- * This function is a shim which creates a SkTArray<GrMipLevel> of size 1.
- * It then calls writePixels with that SkTArray.
- */
- bool writePixels(GrSurface*, GrSurfaceOrigin, int left, int top, int width, int height,
- GrColorType, const void* buffer, size_t rowBytes);
+ bool writePixels(GrSurface* surface, int left, int top, int width, int height,
+ GrColorType srcColorType, const GrMipLevel texels[], int mipLevelCount);
/**
- * This version of writePixels doesn't take an origin. TODO: Remove origin handling from
- * GrGpu::writePixels entirely.
+ * Helper for the case of a single level.
*/
bool writePixels(GrSurface* surface, int left, int top, int width, int height,
GrColorType srcColorType, const void* buffer, size_t rowBytes) {
- return this->writePixels(surface, kTopLeft_GrSurfaceOrigin, left, top, width, height,
- srcColorType, buffer, rowBytes);
+ GrMipLevel mipLevel = {buffer, rowBytes};
+ return this->writePixels(surface, left, top, width, height, srcColorType, &mipLevel, 1);
}
/**
@@ -449,9 +440,8 @@ private:
GrColorType, void* buffer, size_t rowBytes) = 0;
// overridden by backend-specific derived class to perform the surface write
- virtual bool onWritePixels(GrSurface*, GrSurfaceOrigin, int left, int top, int width,
- int height, GrColorType, const GrMipLevel texels[],
- int mipLevelCount) = 0;
+ virtual bool onWritePixels(GrSurface*, int left, int top, int width, int height, GrColorType,
+ const GrMipLevel texels[], int mipLevelCount) = 0;
// overridden by backend-specific derived class to perform the texture transfer
virtual bool onTransferPixels(GrTexture*, int left, int top, int width, int height,