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

Unified Diff: src/core/SkCanvas.cpp

Issue 244763004: add optional origin parameter to accessTopLayerPixels (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 months 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/SkCanvas.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index c57ae9ae5fa4a6079aaa776a05e5ce1028808000..e8da12920f2a75768021e527d7d3cba1cdec4714 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1106,8 +1106,12 @@ const void* SkCanvas::onPeekPixels(SkImageInfo* info, size_t* rowBytes) {
return dev ? dev->peekPixels(info, rowBytes) : NULL;
}
-void* SkCanvas::accessTopLayerPixels(SkImageInfo* info, size_t* rowBytes) {
- return this->onAccessTopLayerPixels(info, rowBytes);
+void* SkCanvas::accessTopLayerPixels(SkImageInfo* info, size_t* rowBytes, SkIPoint* origin) {
+ void* pixels = this->onAccessTopLayerPixels(info, rowBytes);
+ if (pixels && origin) {
+ *origin = this->getTopDevice(false)->getOrigin();
+ }
+ return pixels;
}
void* SkCanvas::onAccessTopLayerPixels(SkImageInfo* info, size_t* rowBytes) {
« no previous file with comments | « include/core/SkCanvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698