diff options
author | bsalomon <bsalomon@google.com> | 2015-07-16 08:23:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-16 08:23:13 -0700 |
commit | e8d21e8f24aa676765d0ff8f433228665c75cdc2 (patch) | |
tree | aafa1819213283a04e2f04a3415da4a899471cfc /src/gpu/GrSurfacePriv.h | |
parent | dbe1e6f0c32bd07b7669b1b1ac3c7f58c9b8d773 (diff) |
Make readpixels work on GrTextures
Review URL: https://codereview.chromium.org/1234313002
Diffstat (limited to 'src/gpu/GrSurfacePriv.h')
-rw-r--r-- | src/gpu/GrSurfacePriv.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gpu/GrSurfacePriv.h b/src/gpu/GrSurfacePriv.h index 47bd44f4ef..bff411edf3 100644 --- a/src/gpu/GrSurfacePriv.h +++ b/src/gpu/GrSurfacePriv.h @@ -17,6 +17,21 @@ implemented privately in GrSurface with a inline public method here). */ class GrSurfacePriv { public: + /** Helpers used in read/write pixels implementations. The paramters are adjusted so that the + read/write respects the bounds of a surface. If the input *rowBytes is 0 it will be + the tight row bytes (based on width and bpp) on output. */ + static bool AdjustReadPixelParams(int surfaceWidth, + int surfaceHeight, + size_t bpp, + int* left, int* top, int* width, int* height, + void** data, + size_t* rowBytes); + static bool AdjustWritePixelParams(int surfaceWidth, + int surfaceHeight, + size_t bpp, + int* left, int* top, int* width, int* height, + const void** data, + size_t* rowBytes); /** * Derive a SkImageInfo from the surface's descriptor. The caller must provide the alpha type as * GrSurface has no equivalent. |