diff options
author | 2017-07-21 11:01:18 -0400 | |
---|---|---|
committer | 2017-07-21 15:27:23 +0000 | |
commit | 353196f44f8c4f5fc3dc3783241faef264b80927 (patch) | |
tree | 2dd4d14e7bb5991dcfdbed98e2ecb4d54d4ddda5 /include/core | |
parent | 35a5e418b96053bbdebef2cceb33db995f960010 (diff) |
clean read/write pixels signatures, augment SkSurface API
For now, not adding writePixels to surface, since it appears we may not
be able to remove writePixels from canvas :(
Bug: skia:3216
Change-Id: I64ccebb31effacffe615ae4537fb46a161a6768d
Reviewed-on: https://skia-review.googlesource.com/25562
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkSurface.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h index b13702e83e..4a8d81205f 100644 --- a/include/core/SkSurface.h +++ b/include/core/SkSurface.h @@ -284,13 +284,13 @@ public: bool peekPixels(SkPixmap*); /** - * Copy the pixels from the surface into the specified buffer (pixels + rowBytes), - * converting them into the requested format (dstInfo). The surface pixels are read + * Copy the pixels from the surface into the specified pixmap, + * converting them into the pixmap's format. The surface pixels are read * starting at the specified (srcX,srcY) location. * - * The specified ImageInfo and (srcX,srcY) offset specifies a source rectangle + * The pixmap and (srcX,srcY) offset specifies a source rectangle * - * srcR.setXYWH(srcX, srcY, dstInfo.width(), dstInfo.height()); + * srcR.setXYWH(srcX, srcY, pixmap.width(), pixmap.height()); * * srcR is intersected with the bounds of the base-layer. If this intersection is not empty, * then we have two sets of pixels (of equal size). Replace the dst pixels with the @@ -301,8 +301,10 @@ public: * - If srcR does not intersect the surface bounds. * - If the requested colortype/alphatype cannot be converted from the surface's types. */ + bool readPixels(const SkPixmap& dst, int srcX, int srcY); bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY); + bool readPixels(const SkBitmap& dst, int srcX, int srcY); const SkSurfaceProps& props() const { return fProps; } |