From 884e97cb04db7ed053a866567ee9c6e4c01f993a Mon Sep 17 00:00:00 2001 From: reed Date: Tue, 26 May 2015 11:31:54 -0700 Subject: change internals over to SkPixmap and stop using accessBitmap BUG=skia: Review URL: https://codereview.chromium.org/1155443004 --- include/core/SkDevice.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'include/core/SkDevice.h') diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h index 3bdcfcf8a3..c23b2973ee 100644 --- a/include/core/SkDevice.h +++ b/include/core/SkDevice.h @@ -82,7 +82,7 @@ public: bool writePixels(const SkImageInfo&, const void*, size_t rowBytes, int x, int y); - void* accessPixels(SkImageInfo* info, size_t* rowBytes); + bool accessPixels(SkPixmap* pmap); /** * Return the device's associated gpu render target, or NULL. @@ -239,7 +239,9 @@ protected: virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, const SkPath&, const SkMatrix*, const SkPaint&); + bool readPixels(const SkImageInfo&, void* dst, size_t rowBytes, int x, int y); + bool peekPixels(SkPixmap*); /////////////////////////////////////////////////////////////////////////// @@ -272,11 +274,8 @@ protected: } protected: - // default impl returns NULL - virtual SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&); - - // default impl returns NULL - virtual const void* peekPixels(SkImageInfo*, size_t* rowBytes); + virtual SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) { return NULL; } + virtual bool onPeekPixels(SkPixmap*) { return false; } /** * The caller is responsible for "pre-clipping" the dst. The impl can assume that the dst @@ -294,10 +293,7 @@ protected: */ virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int x, int y); - /** - * Default impl returns NULL. - */ - virtual void* onAccessPixels(SkImageInfo* info, size_t* rowBytes); + virtual bool onAccessPixels(SkPixmap*) { return false; } /** * Leaky properties are those which the device should be applying but it isn't. -- cgit v1.2.3