aboutsummaryrefslogtreecommitdiffhomepage
path: root/gpu/include/GrContext.h
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-01-18 21:50:41 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-01-18 21:50:41 +0000
commit01804b44f9e4c468ef94aa3fe609a0a1b65fde3d (patch)
treeaab0703dbb99aba97ad7ccdf2743da69bb58b3fb /gpu/include/GrContext.h
parent63100f9e36430ae03bba309825f35040cbfa0741 (diff)
add getter/setter for TextureCache, so that clients can make their budget
decisions at runtime or per-context, rather than just at compile-time. Leaving in the default values as is. git-svn-id: http://skia.googlecode.com/svn/trunk@709 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/include/GrContext.h')
-rw-r--r--gpu/include/GrContext.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/gpu/include/GrContext.h b/gpu/include/GrContext.h
index 905fe50411..fdf0e9fd1b 100644
--- a/gpu/include/GrContext.h
+++ b/gpu/include/GrContext.h
@@ -287,6 +287,29 @@ public:
GrRenderTarget* fPrevTarget;
};
+ ///////////////////////////////////////////////////////////////////////////
+
+ /**
+ * 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.
+ */
+ void getTextureCacheLimits(int* maxTextures, size_t* maxTextureBytes) 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.
+ *
+ * @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);
+
/* -------------------------------------------------------
*/