aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkSurface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/image/SkSurface.cpp')
-rw-r--r--src/image/SkSurface.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp
index 3ca5747252..13b7d65546 100644
--- a/src/image/SkSurface.cpp
+++ b/src/image/SkSurface.cpp
@@ -170,6 +170,20 @@ const void* SkSurface::peekPixels(SkImageInfo* info, size_t* rowBytes) {
return this->getCanvas()->peekPixels(info, rowBytes);
}
+bool SkSurface::readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes,
+ int srcX, int srcY) {
+ return this->getCanvas()->readPixels(dstInfo, dstPixels, dstRowBytes, srcX, srcY);
+}
+
+bool SkSurface::readPixels(SkBitmap* dst, const SkIRect* srcRect) {
+ SkIRect storage;
+ if (NULL == srcRect) {
+ storage.set(0, 0, this->width(), this->height());
+ srcRect = &storage;
+ }
+ return this->getCanvas()->readPixels(*srcRect, dst);
+}
+
//////////////////////////////////////////////////////////////////////////////////////
#ifdef SK_SUPPORT_LEGACY_TEXTRENDERMODE