Index: src/core/SkCanvas.cpp |
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
index 35710fb3171514d4dd560009a941f3b54ef411b5..d60e0e921158aba69704084530de0802ceea0a88 100644 |
--- a/src/core/SkCanvas.cpp |
+++ b/src/core/SkCanvas.cpp |
@@ -1335,18 +1335,24 @@ SkImageInfo SkCanvas::imageInfo() const { |
} |
} |
+#ifdef SK_SUPPORT_LEGACY_PEEKPIXELS_PARMS |
const void* SkCanvas::peekPixels(SkImageInfo* info, size_t* rowBytes) { |
SkPixmap pmap; |
- if (!this->onPeekPixels(&pmap)) { |
- return nullptr; |
- } |
- if (info) { |
- *info = pmap.info(); |
- } |
- if (rowBytes) { |
- *rowBytes = pmap.rowBytes(); |
+ if (this->peekPixels(&pmap)) { |
+ if (info) { |
+ *info = pmap.info(); |
+ } |
+ if (rowBytes) { |
+ *rowBytes = pmap.rowBytes(); |
+ } |
+ return pmap.addr(); |
} |
- return pmap.addr(); |
+ return nullptr; |
+} |
+#endif |
+ |
+bool SkCanvas::peekPixels(SkPixmap* pmap) { |
+ return this->onPeekPixels(pmap); |
} |
bool SkCanvas::onPeekPixels(SkPixmap* pmap) { |