'skia_scalar%': 'float',
'skia_mesa%': 0,
'skia_nv_path_rendering%': 0,
+ 'skia_texture_cache_mb_limit%': 0,
'skia_angle%': 0,
'skia_directwrite%': 0,
'skia_nacl%': 0,
'skia_scalar%': '<(skia_scalar)',
'skia_mesa%': '<(skia_mesa)',
'skia_nv_path_rendering%': '<(skia_nv_path_rendering)',
+ 'skia_texture_cache_mb_limit%': '<(skia_texture_cache_mb_limit)',
'skia_angle%': '<(skia_angle)',
'skia_arch_width%': '<(skia_arch_width)',
'skia_arch_type%': '<(skia_arch_type)',
],
},
}],
+ [ 'skia_texture_cache_mb_limit != 0', {
+ 'defines': [
+ 'GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT=<(skia_texture_cache_mb_limit)',
+ ],
+ }],
],
'direct_dependent_settings': {
'conditions': [
#define GR_GEOM_BUFFER_LOCK_THRESHOLD (1 << 15)
#endif
+/**
+ * GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT gives a threshold (in megabytes) for the
+ * maximum size of the texture cache in vram. The value is only a default and
+ * can be overridden at runtime.
+ */
+#if !defined(GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT)
+ #define GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT 96
+#endif
+
///////////////////////////////////////////////////////////////////////////////
// tail section:
//
*/
//#define GR_GEOM_BUFFER_LOCK_THRESHOLD (1<<15)
+/**
+ * This gives a threshold in megabytes for the maximum size of the texture cache
+ * in vram. The value is only a default and can be overridden at runtime.
+ */
+//#define GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT 96
+
///////////////////////////////////////////////////////////////////////////////
// Decide Ganesh types
#endif
static const size_t MAX_TEXTURE_CACHE_COUNT = 2048;
-static const size_t MAX_TEXTURE_CACHE_BYTES = 96 * 1024 * 1024;
+static const size_t MAX_TEXTURE_CACHE_BYTES = GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT * 1024 * 1024;
static const size_t DRAW_BUFFER_VBPOOL_BUFFER_SIZE = 1 << 15;
static const int DRAW_BUFFER_VBPOOL_PREALLOC_BUFFERS = 4;