Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(682)

Unified Diff: src/image/SkSurface.cpp

Issue 789993002: add readPixels to SkSurface (later try to remove it from SkCanvas) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkSurface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkSurface.cpp
diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp
index 3ca5747252bd147da14c18ec8f5494bca99291c7..13b7d65546172c604f0ff257838fde8062470e37 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
« no previous file with comments | « include/core/SkSurface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698