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

Unified Diff: src/utils/android/SkAndroidSDKCanvas.cpp

Issue 1151673004: Fix SkAndroidSDKCanvas virtuals (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reviews Created 5 years, 7 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 | « src/utils/android/SkAndroidSDKCanvas.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/android/SkAndroidSDKCanvas.cpp
diff --git a/src/utils/android/SkAndroidSDKCanvas.cpp b/src/utils/android/SkAndroidSDKCanvas.cpp
index 06b960b5d9d08ae9d9feb3e7a4e47250091c297f..883abb8aa24c4fe2d982667254c24b90744290a6 100644
--- a/src/utils/android/SkAndroidSDKCanvas.cpp
+++ b/src/utils/android/SkAndroidSDKCanvas.cpp
@@ -273,12 +273,28 @@ SkSurface* SkAndroidSDKCanvas::onNewSurface(const SkImageInfo& info,
return fProxyTarget->newSurface(info, &props);
}
-const void* SkAndroidSDKCanvas::onPeekPixels(SkImageInfo* info, size_t* data) {
- return fProxyTarget->peekPixels(info, data);
+bool SkAndroidSDKCanvas::onPeekPixels(SkPixmap* pmap) {
+ SkASSERT(pmap);
+ SkImageInfo info;
+ size_t rowBytes;
+ const void* addr = fProxyTarget->peekPixels(&info, &rowBytes);
+ if (addr) {
+ pmap->reset(info, addr, rowBytes);
+ return true;
+ }
+ return false;
}
-void* SkAndroidSDKCanvas::onAccessTopLayerPixels(SkImageInfo* info, size_t* data) {
- return fProxyTarget->accessTopLayerPixels(info, data);
+bool SkAndroidSDKCanvas::onAccessTopLayerPixels(SkPixmap* pmap) {
+ SkASSERT(pmap);
+ SkImageInfo info;
+ size_t rowBytes;
+ const void* addr = fProxyTarget->accessTopLayerPixels(&info, &rowBytes, NULL);
+ if (addr) {
+ pmap->reset(info, addr, rowBytes);
+ return true;
+ }
+ return false;
}
void SkAndroidSDKCanvas::willSave() {
« no previous file with comments | « src/utils/android/SkAndroidSDKCanvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698