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() { |