Index: src/utils/SkDeferredCanvas.cpp |
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp |
index 9051874870b5884f62a273b28bcc10456e8fe441..2e3f5bb6a5bea72b2dcbf37dd0bfc6c9a9656478 100644 |
--- a/src/utils/SkDeferredCanvas.cpp |
+++ b/src/utils/SkDeferredCanvas.cpp |
@@ -171,9 +171,12 @@ public: |
protected: |
virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; |
+#ifdef SK_SUPPORT_LEGACY_READPIXELSCONFIG |
virtual bool onReadPixels(const SkBitmap& bitmap, |
int x, int y, |
SkCanvas::Config8888 config8888) SK_OVERRIDE; |
+#endif |
+ virtual bool onReadPixels(const SkImageInfo&, void*, size_t, int x, int y) SK_OVERRIDE; |
virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int x, int y) SK_OVERRIDE; |
// The following methods are no-ops on a deferred device |
@@ -506,12 +509,20 @@ SkSurface* SkDeferredDevice::newSurface(const SkImageInfo& info) { |
return this->immediateDevice()->newSurface(info); |
} |
+#ifdef SK_SUPPORT_LEGACY_READPIXELSCONFIG |
bool SkDeferredDevice::onReadPixels( |
const SkBitmap& bitmap, int x, int y, SkCanvas::Config8888 config8888) { |
this->flushPendingCommands(kNormal_PlaybackMode); |
return fImmediateCanvas->readPixels(const_cast<SkBitmap*>(&bitmap), |
x, y, config8888); |
} |
+#endif |
+ |
+bool SkDeferredDevice::onReadPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, |
+ int x, int y) { |
+ this->flushPendingCommands(kNormal_PlaybackMode); |
+ return fImmediateCanvas->readPixels(info, pixels, rowBytes, x, y); |
+} |
class AutoImmediateDrawIfNeeded { |
public: |