From: commit-bot@chromium.org Date: Wed, 12 Mar 2014 03:04:08 +0000 (+0000) Subject: make onReadPixels protected and have default impl (so we can remove chrome override) X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~8704 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2cccf833265a607be62f1d77ee51662b49d9e813;p=platform%2Fupstream%2FlibSkiaSharp.git make onReadPixels protected and have default impl (so we can remove chrome override) R=reed@google.com TBR=bsalomon@google.com Author: reed@chromium.org Review URL: https://codereview.chromium.org/196543004 git-svn-id: http://skia.googlecode.com/svn/trunk@13756 2bbb7eff-a529-9590-31e7-b0007b416f81 --- diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h index b78dfbf..90bdfa3 100644 --- a/include/core/SkDevice.h +++ b/include/core/SkDevice.h @@ -336,17 +336,6 @@ protected: */ virtual const SkBitmap& onAccessBitmap() = 0; - /** - * Implements readPixels API. The caller will ensure that: - * 1. bitmap has pixel config kARGB_8888_Config. - * 2. bitmap has pixels. - * 3. The rectangle (x, y, x + bitmap->width(), y + bitmap->height()) is - * contained in the device bounds. - */ - virtual bool onReadPixels(const SkBitmap& bitmap, - int x, int y, - SkCanvas::Config8888 config8888) = 0; - /** Called when this device is installed into a Canvas. Balanced by a call to unlockPixels() when the device is removed from a Canvas. */ @@ -392,6 +381,17 @@ protected: virtual const void* peekPixels(SkImageInfo*, size_t* rowBytes); /** + * Implements readPixels API. The caller will ensure that: + * 1. bitmap has pixel config kARGB_8888_Config. + * 2. bitmap has pixels. + * 3. The rectangle (x, y, x + bitmap->width(), y + bitmap->height()) is + * contained in the device bounds. + */ + virtual bool onReadPixels(const SkBitmap& bitmap, + int x, int y, + SkCanvas::Config8888 config8888); + + /** * The caller is responsible for "pre-clipping" the src. The impl can assume that the src * image at the specified x,y offset will fit within the device's bounds. * diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp index b9c923c..666e456 100644 --- a/src/core/SkDevice.cpp +++ b/src/core/SkDevice.cpp @@ -190,6 +190,10 @@ bool SkBaseDevice::onWritePixels(const SkImageInfo&, const void*, size_t, int, i return false; } +bool SkBaseDevice::onReadPixels(const SkBitmap&, int x, int y, SkCanvas::Config8888) { + return false; +} + #ifdef SK_SUPPORT_LEGACY_WRITEPIXELSCONFIG void SkBaseDevice::writePixels(const SkBitmap&, int x, int y, SkCanvas::Config8888) {} #endif