diff options
author | 2011-07-26 20:45:30 +0000 | |
---|---|---|
committer | 2011-07-26 20:45:30 +0000 | |
commit | 50398bf7f1953e640e5529616e710cf540799731 (patch) | |
tree | accbef2fe1e1a9a839461c1d2b5cac1eda6d609d /include/gpu | |
parent | f131694617ce0410eafcb01124459382576bb1d9 (diff) |
Make GrTextureCache into a generic GrResource cache. Also some GrContext texture interface cleanup.
http://codereview.appspot.com/4815055/
git-svn-id: http://skia.googlecode.com/svn/trunk@1965 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/SkGpuDevice.h | 25 | ||||
-rw-r--r-- | include/gpu/SkGr.h | 9 |
2 files changed, 17 insertions, 17 deletions
diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h index bddf24ec3a..b4ab1856f3 100644 --- a/include/gpu/SkGpuDevice.h +++ b/include/gpu/SkGpuDevice.h @@ -22,6 +22,7 @@ #include "SkBitmap.h" #include "SkDevice.h" #include "SkRegion.h" +#include "GrContext.h" struct SkDrawProcs; struct GrSkDrawProcs; @@ -126,18 +127,16 @@ public: virtual void makeRenderTargetCurrent(); protected: - - class TexCache; + typedef GrContext::TextureCacheEntry TexCache; enum TexType { kBitmap_TexType, kDeviceRenderTarget_TexType, kSaveLayerDeviceRenderTarget_TexType }; - TexCache* lockCachedTexture(const SkBitmap& bitmap, - const GrSamplerState& sampler, - GrTexture** texture, - TexType type = kBitmap_TexType); - void unlockCachedTexture(TexCache*); + TexCache lockCachedTexture(const SkBitmap& bitmap, + const GrSamplerState& sampler, + TexType type = kBitmap_TexType); + void unlockCachedTexture(TexCache); class SkAutoCachedTexture { public: @@ -152,7 +151,7 @@ protected: private: SkGpuDevice* fDevice; - TexCache* fTex; + TexCache fTex; }; friend class SkAutoTexCache; @@ -162,11 +161,11 @@ private: GrSkDrawProcs* fDrawProcs; // state for our offscreen render-target - TexCache* fCache; - GrTexture* fTexture; - GrRenderTarget* fRenderTarget; - bool fNeedClear; - bool fNeedPrepareRenderTarget; + TexCache fCache; + GrTexture* fTexture; + GrRenderTarget* fRenderTarget; + bool fNeedClear; + bool fNeedPrepareRenderTarget; // called from rt and tex cons void initFromRenderTarget(GrContext*, GrRenderTarget*); diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h index 65565c9b68..e2656aec0d 100644 --- a/include/gpu/SkGr.h +++ b/include/gpu/SkGr.h @@ -231,10 +231,11 @@ private: //////////////////////////////////////////////////////////////////////////////// // Helper functions -GrTextureEntry* sk_gr_create_bitmap_texture(GrContext* ctx, - GrTextureKey* key, - const GrSamplerState& sampler, - const SkBitmap& bitmap); +static const GrContext::TextureKey gUNCACHED_KEY = ~0; +GrContext::TextureCacheEntry sk_gr_create_bitmap_texture(GrContext* ctx, + GrContext::TextureKey key, + const GrSamplerState& sampler, + const SkBitmap& bitmap); #endif |