From 8f7e1dac5c92bf1f53feb603a9bd249d53afa81a Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Thu, 21 Jun 2012 19:48:32 +0000 Subject: Remove count budget from resource cache Review URL: http://codereview.appspot.com/6312052/ git-svn-id: http://skia.googlecode.com/svn/trunk@4287 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/gpu/GrContext.h | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'include/gpu/GrContext.h') diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index 0cd5116cff..9389499ec4 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -83,11 +83,6 @@ public: */ void freeGpuResources(); - /** - * Returns the number of bytes of GPU memory hosted by the texture cache. - */ - size_t getGpuTextureCacheBytes() const; - /////////////////////////////////////////////////////////////////////////// // Textures @@ -212,25 +207,28 @@ public: int height) const; /** - * Return the current texture cache limits. - * - * @param maxTextures If non-null, returns maximum number of textures that - * can be held in the cache. - * @param maxTextureBytes If non-null, returns maximum number of bytes of - * texture memory that can be held in the cache. + * Return the current texture cache budget in bytes. */ - void getTextureCacheLimits(int* maxTextures, size_t* maxTextureBytes) const; + size_t getTextureCacheBudget() const; /** - * Specify the texture cache limits. If the current cache exceeds either - * of these, it will be purged (LRU) to keep the cache within these limits. + * Specify the texture cache budget. If the current cache size exceeds the + * budget it will immediately be purged to be within the budget. * - * @param maxTextures The maximum number of textures that can be held in - * the cache. * @param maxTextureBytes The maximum number of bytes of texture memory * that can be held in the cache. */ - void setTextureCacheLimits(int maxTextures, size_t maxTextureBytes); + void setTextureCacheBudget(size_t maxTextureBytes); + // DEPRECATED, this will be deleted soon. + void setTextureCacheLimits(int ignored, size_t maxTextureBytes) { + this->setTextureCacheBudget(maxTextureBytes); + } + + /** + * Returns the current number of bytes of GPU memory hosted by the texture + * cache. + */ + size_t getGpuTextureCacheBytes() const; /** * Return the max width or height of a texture supported by the current gpu -- cgit v1.2.3