'skia_nv_path_rendering%': 0,
'skia_stroke_path_rendering%': 0,
'skia_android_path_rendering%': 0,
- 'skia_texture_cache_mb_limit%': 0,
+ 'skia_resource_cache_mb_limit%': 0,
+ 'skia_resource_cache_count_limit%': 0,
'skia_angle%': 0,
'skia_directwrite%': 0,
'skia_gpu%': 1,
'skia_nv_path_rendering%': '<(skia_nv_path_rendering)',
'skia_stroke_path_rendering%': '<(skia_stroke_path_rendering)',
'skia_android_path_rendering%': '<(skia_android_path_rendering)',
- 'skia_texture_cache_mb_limit%': '<(skia_texture_cache_mb_limit)',
+ 'skia_resource_cache_mb_limit%': '<(skia_resource_cache_mb_limit)',
+ 'skia_resource_cache_count_limit%': '<(skia_resource_cache_count_limit)',
'skia_angle%': '<(skia_angle)',
'skia_arch_width%': '<(skia_arch_width)',
'skia_arch_type%': '<(skia_arch_type)',
],
},
}],
- [ 'skia_texture_cache_mb_limit != 0', {
+ [ 'skia_resource_cache_mb_limit != 0', {
'defines': [
- 'GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT=<(skia_texture_cache_mb_limit)',
+ 'GR_DEFAULT_RESOURCE_CACHE_MB_LIMIT=<(skia_resource_cache_mb_limit)',
+ ],
+ }],
+ [ 'skia_resource_cache_count_limit != 0', {
+ 'defines': [
+ 'GR_DEFAULT_RESOURCE_CACHE_COUNT_LIMIT=<(skia_resource_cache_count_limit)',
],
}],
],
* GR_USER_CONFIG_FILE. It should be defined relative to GrConfig.h
*
* e.g. it can change the BUILD target or supply its own defines for anything
- * else (e.g. GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT)
+ * else (e.g. GR_DEFAULT_RESOURCE_CACHE_MB_LIMIT)
*/
#if !defined(GR_USER_CONFIG_FILE)
#include "GrUserConfig.h"
#endif
/**
- * GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT gives a threshold (in megabytes) for the
+ * GR_DEFAULT_RESOURCE_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
+#if !defined(GR_DEFAULT_RESOURCE_CACHE_MB_LIMIT)
+ #define GR_DEFAULT_RESOURCE_CACHE_MB_LIMIT 96
+#endif
+
+/**
+ * GR_DEFAULT_RESOURCE_CACHE_COUNT_LIMIT specifies the maximum number of
+ * textures the texture cache can hold in vram. The value is only a default and
+ * can be overridden at runtime.
+ */
+#if !defined(GR_DEFAULT_RESOURCE_CACHE_COUNT_LIMIT)
+ #define GR_DEFAULT_RESOURCE_CACHE_COUNT_LIMIT 2048
#endif
/**
* 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
+//#define GR_DEFAULT_RESOURCE_CACHE_MB_LIMIT 96
+
+/**
+ * This specifies the maximum number of textures the texture cache can hold
+ * in vram. The value is only a default and can be overridden at runtime.
+ */
+//#define GR_DEFAULT_RESOURCE_CACHE_COUNT_LIMIT 2048
#endif
case $TARGET_DEVICE in
nexus_s)
DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 arm_version=7 arm_thumb=1"
- DEFINES="${DEFINES} skia_texture_cache_mb_limit=24"
+ DEFINES="${DEFINES} skia_resource_cache_mb_limit=24"
ANDROID_ARCH="arm"
;;
nexus_4 | nexus_7 | nexus_10)
;;
galaxy_nexus)
DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 arm_version=7 arm_thumb=1"
- DEFINES="${DEFINES} skia_texture_cache_mb_limit=32"
+ DEFINES="${DEFINES} skia_resource_cache_mb_limit=32"
ANDROID_ARCH="arm"
;;
intel_rhb)
DEFINES="${DEFINES} skia_arch_type=x86 skia_arch_width=32"
- DEFINES="${DEFINES} skia_texture_cache_mb_limit=32"
+ DEFINES="${DEFINES} skia_resource_cache_mb_limit=32"
ANDROID_ARCH="x86"
;;
razr_i)
DEFINES="${DEFINES} skia_arch_type=x86 skia_arch_width=32"
- DEFINES="${DEFINES} skia_texture_cache_mb_limit=32"
+ DEFINES="${DEFINES} skia_resource_cache_mb_limit=32"
ANDROID_ARCH="x86"
;;
arm_v7)
;;
x86)
DEFINES="${DEFINES} skia_arch_type=x86 skia_arch_width=32"
- DEFINES="${DEFINES} skia_texture_cache_mb_limit=32"
+ DEFINES="${DEFINES} skia_resource_cache_mb_limit=32"
ANDROID_ARCH="x86"
;;
*)
#define GR_DEBUG_PARTIAL_COVERAGE_CHECK 0
#endif
-static const size_t MAX_TEXTURE_CACHE_COUNT = 2048;
-static const size_t MAX_TEXTURE_CACHE_BYTES = GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT * 1024 * 1024;
+static const size_t MAX_RESOURCE_CACHE_COUNT = GR_DEFAULT_RESOURCE_CACHE_COUNT_LIMIT;
+static const size_t MAX_RESOURCE_CACHE_BYTES = GR_DEFAULT_RESOURCE_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;
fGpu->setDrawState(fDrawState);
fTextureCache = SkNEW_ARGS(GrResourceCache,
- (MAX_TEXTURE_CACHE_COUNT,
- MAX_TEXTURE_CACHE_BYTES));
+ (MAX_RESOURCE_CACHE_COUNT,
+ MAX_RESOURCE_CACHE_BYTES));
fTextureCache->setOverbudgetCallback(OverbudgetCB, this);
fFontCache = SkNEW_ARGS(GrFontCache, (fGpu));