diff options
Diffstat (limited to 'include/gpu/SkGrTexturePixelRef.h')
-rw-r--r-- | include/gpu/SkGrTexturePixelRef.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/gpu/SkGrTexturePixelRef.h b/include/gpu/SkGrTexturePixelRef.h index 1f5133f..5bc64f5 100644 --- a/include/gpu/SkGrTexturePixelRef.h +++ b/include/gpu/SkGrTexturePixelRef.h @@ -40,11 +40,38 @@ protected: // override from SkPixelRef virtual void onUnlockPixels() {} + virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subset); private: GrTexture* fTexture; typedef SkPixelRef INHERITED; }; +class SkGrRenderTargetPixelRef : public SkPixelRef { +public: + SkGrRenderTargetPixelRef(GrRenderTarget* rt); + virtual ~SkGrRenderTargetPixelRef(); + + // override from SkPixelRef + virtual SkGpuTexture* getTexture(); + +protected: + // override from SkPixelRef + virtual void* onLockPixels(SkColorTable** ptr) { + if (ptr) { + *ptr = NULL; + } + return NULL; + } + + // override from SkPixelRef + virtual void onUnlockPixels() {} + virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subset); + +private: + GrRenderTarget* fRenderTarget; + typedef SkPixelRef INHERITED; +}; + #endif |