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

Unified Diff: src/utils/SkDeferredCanvas.cpp

Issue 199413013: add new readPixels with direct memory parameters (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 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
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:

Powered by Google App Engine
This is Rietveld 408576698