diff options
author | 2012-06-28 20:02:39 +0000 | |
---|---|---|
committer | 2012-06-28 20:02:39 +0000 | |
commit | d881bc194d7c24294029b5c08e6e549a9fd9b6f3 (patch) | |
tree | 8f05adad1714663ea427d6d4a5ef814ae58eef58 /include/gpu | |
parent | fc937347bf293651d696e34506e641871ea3e04d (diff) |
Collapsed SkGrTexturePixelRef and SkGrRenderTargetPixelRef into SkGrPixelRef using new GrSurface class
http://codereview.appspot.com/6359045/
git-svn-id: http://skia.googlecode.com/svn/trunk@4396 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/SkGrTexturePixelRef.h | 47 |
1 files changed, 10 insertions, 37 deletions
diff --git a/include/gpu/SkGrTexturePixelRef.h b/include/gpu/SkGrTexturePixelRef.h index fd0e750ec1..b7eaf0d11a 100644 --- a/include/gpu/SkGrTexturePixelRef.h +++ b/include/gpu/SkGrTexturePixelRef.h @@ -8,8 +8,8 @@ -#ifndef SkGrTexturePixelRef_DEFINED -#define SkGrTexturePixelRef_DEFINED +#ifndef SkGrPixelRef_DEFINED +#define SkGrPixelRef_DEFINED #include "SkBitmap.h" #include "SkPixelRef.h" @@ -38,52 +38,25 @@ private: }; /** - * PixelRef that wraps a GrTexture + * PixelRef that wraps a GrSurface */ -class SK_API SkGrTexturePixelRef : public SkROLockPixelsPixelRef { +class SK_API SkGrPixelRef : public SkROLockPixelsPixelRef { public: - SkGrTexturePixelRef(GrTexture*); - virtual ~SkGrTexturePixelRef(); + SkGrPixelRef(GrSurface* surface); + virtual ~SkGrPixelRef(); // override from SkPixelRef - virtual SkGpuTexture* getTexture(); + virtual SkGpuTexture* getTexture() SK_OVERRIDE; SK_DECLARE_UNFLATTENABLE_OBJECT() protected: - // override from SkPixelRef - virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subset); - - // override from SkPixelRef - virtual SkPixelRef* deepCopy(SkBitmap::Config dstConfig) SK_OVERRIDE; - -private: - GrTexture* fTexture; - typedef SkROLockPixelsPixelRef INHERITED; -}; - -/** - * PixelRef that wraps a GrRenderTarget - */ -class SK_API SkGrRenderTargetPixelRef : public SkROLockPixelsPixelRef { -public: - SkGrRenderTargetPixelRef(GrRenderTarget* rt); - virtual ~SkGrRenderTargetPixelRef(); - - // override from SkPixelRef - virtual SkGpuTexture* getTexture(); - - SK_DECLARE_UNFLATTENABLE_OBJECT() - -protected: - // override from SkPixelRef - virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subset); - - // override from SkPixelRef + // overrides from SkPixelRef + virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subset) SK_OVERRIDE; virtual SkPixelRef* deepCopy(SkBitmap::Config dstConfig) SK_OVERRIDE; private: - GrRenderTarget* fRenderTarget; + GrSurface* fSurface; typedef SkROLockPixelsPixelRef INHERITED; }; |