diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2010-12-23 19:29:18 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2010-12-23 19:29:18 +0000 |
commit | 51df9e3fe3c1aec370854b2718df16fc02faa1b2 (patch) | |
tree | 7d7c5e397ea73c23a21b30defd9231404eafb61a /src/core | |
parent | da96ea01fe2a7f4237712c68fae2b96d3523b0f5 (diff) |
add gpu to gm tool
add pass-through read/write pixels API to canvas
git-svn-id: http://skia.googlecode.com/svn/trunk@660 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkCanvas.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 764e063282..076164147d 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -549,6 +549,31 @@ SkDevice* SkCanvas::setBitmapDevice(const SkBitmap& bitmap, bool forLayer) { return device; } +bool SkCanvas::readPixels(const SkIRect& srcRect, SkBitmap* bitmap) { + SkDevice* device = this->getDevice(); + if (!device) { + return false; + } + return device->readPixels(srcRect, bitmap); +} + +bool SkCanvas::readPixels(SkBitmap* bitmap) { + SkDevice* device = this->getDevice(); + if (!device) { + return false; + } + SkIRect bounds; + bounds.set(0, 0, device->width(), device->height()); + return this->readPixels(bounds, bitmap); +} + +void SkCanvas::writePixels(const SkBitmap& bitmap, int x, int y) { + SkDevice* device = this->getDevice(); + if (device) { + device->writePixels(bitmap, x, y); + } +} + ////////////////////////////////////////////////////////////////////////////// bool SkCanvas::getViewport(SkIPoint* size) const { |