diff options
Diffstat (limited to 'include/core/SkPixelRef.h')
-rw-r--r-- | include/core/SkPixelRef.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h index 177ecec..8fb368a 100644 --- a/include/core/SkPixelRef.h +++ b/include/core/SkPixelRef.h @@ -20,7 +20,9 @@ #include "SkRefCnt.h" #include "SkString.h" +class SkBitmap; class SkColorTable; +struct SkIRect; class SkMutex; class SkFlattenableReadBuffer; class SkFlattenableWriteBuffer; @@ -112,6 +114,8 @@ public: */ virtual SkGpuTexture* getTexture() { return NULL; } + bool readPixels(SkBitmap* dst, const SkIRect* subset = NULL); + // serialization typedef SkPixelRef* (*Factory)(SkFlattenableReadBuffer&); @@ -157,6 +161,14 @@ protected: */ virtual void onUnlockPixels() = 0; + /** + * For pixelrefs that don't have access to their raw pixels, they may be + * able to make a copy of them (e.g. if the pixels are on the GPU). + * + * The base class implementation returns false; + */ + virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subsetOrNull); + /** Return the mutex associated with this pixelref. This value is assigned in the constructor, and cannot change during the lifetime of the object. */ |