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

Unified Diff: include/core/SkDevice.h

Issue 1155443004: change internals over to SkPixmap and stop using accessBitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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: include/core/SkDevice.h
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index 3bdcfcf8a3e8f31e5709aed807630288a796b97c..c23b2973ee27eadc4f79619817aa7898543bb501 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.
« no previous file with comments | « include/core/SkCanvas.h ('k') | include/core/SkPixmap.h » ('j') | src/core/SkPixmap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698