diff options
author | Mike Reed <reed@google.com> | 2017-07-21 11:01:18 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-21 15:27:23 +0000 |
commit | 353196f44f8c4f5fc3dc3783241faef264b80927 (patch) | |
tree | 2dd4d14e7bb5991dcfdbed98e2ecb4d54d4ddda5 /src/core/SkBitmapDevice.cpp | |
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 'src/core/SkBitmapDevice.cpp')
-rw-r--r-- | src/core/SkBitmapDevice.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp index 05920495c9..b3ab7fc03c 100644 --- a/src/core/SkBitmapDevice.cpp +++ b/src/core/SkBitmapDevice.cpp @@ -150,23 +150,21 @@ bool SkBitmapDevice::onPeekPixels(SkPixmap* pmap) { return false; } -bool SkBitmapDevice::onWritePixels(const SkImageInfo& srcInfo, const void* srcPixels, - size_t srcRowBytes, int x, int y) { +bool SkBitmapDevice::onWritePixels(const SkPixmap& pm, int x, int y) { // since we don't stop creating un-pixeled devices yet, check for no pixels here if (nullptr == fBitmap.getPixels()) { return false; } - if (fBitmap.writePixels(SkPixmap(srcInfo, srcPixels, srcRowBytes), x, y)) { + if (fBitmap.writePixels(pm, x, y)) { fBitmap.notifyPixelsChanged(); return true; } return false; } -bool SkBitmapDevice::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, - int x, int y) { - return fBitmap.readPixels(dstInfo, dstPixels, dstRowBytes, x, y); +bool SkBitmapDevice::onReadPixels(const SkPixmap& pm, int x, int y) { + return fBitmap.readPixels(pm, x, y); } /////////////////////////////////////////////////////////////////////////////// |