diff options
author | Jamie Gennis <jgennis@google.com> | 2011-11-19 16:25:24 -0800 |
---|---|---|
committer | Jamie Gennis <jgennis@google.com> | 2011-11-21 11:48:17 -0800 |
commit | 6f0f0b186533ec0a1f11fd577c0c6dfa9dd29481 (patch) | |
tree | 13ad917df9a7bb4b37e46f18d3a52b5a3f199d6b /opengl | |
parent | 0e2c2f3971eb4b246a5c1b198370e003668f53ee (diff) | |
download | frameworks_base-6f0f0b186533ec0a1f11fd577c0c6dfa9dd29481.zip frameworks_base-6f0f0b186533ec0a1f11fd577c0c6dfa9dd29481.tar.gz frameworks_base-6f0f0b186533ec0a1f11fd577c0c6dfa9dd29481.tar.bz2 |
EGL: Use cache sizes defined in the BoardConfig
This change introduces two new BoardConfig variables to control the size
limits of the EGL blob cache. MAX_EGL_CACHE_ENTRY_SIZE is the size
limit for values inserted into the cache, and MAX_EGL_CACHE_SIZE is the
size limit for all entries in the entire cache (including both keys and
values). If either of these BoardConfig variables are not defined then
a default size limit is used instead.
Change-Id: I6703d93f966b6389c6499f23d841e42339f9c9d7
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/libs/Android.mk | 9 | ||||
-rw-r--r-- | opengl/libs/EGL/egl_cache.cpp | 12 |
2 files changed, 18 insertions, 3 deletions
diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk index 5855b63..9c1a10e 100644 --- a/opengl/libs/Android.mk +++ b/opengl/libs/Android.mk @@ -44,10 +44,17 @@ ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER endif +ifneq ($(MAX_EGL_CACHE_ENTRY_SIZE),) + LOCAL_CFLAGS += -DMAX_EGL_CACHE_ENTRY_SIZE=$(MAX_EGL_CACHE_ENTRY_SIZE) +endif + +ifneq ($(MAX_EGL_CACHE_SIZE),) + LOCAL_CFLAGS += -DMAX_EGL_CACHE_SIZE=$(MAX_EGL_CACHE_SIZE) +endif + include $(BUILD_SHARED_LIBRARY) installed_libEGL := $(LOCAL_INSTALLED_MODULE) - # OpenGL drivers config file ifneq ($(BOARD_EGL_CFG),) diff --git a/opengl/libs/EGL/egl_cache.cpp b/opengl/libs/EGL/egl_cache.cpp index fe32d43..c4a7466 100644 --- a/opengl/libs/EGL/egl_cache.cpp +++ b/opengl/libs/EGL/egl_cache.cpp @@ -25,10 +25,18 @@ #include <sys/types.h> #include <unistd.h> +#ifndef MAX_EGL_CACHE_ENTRY_SIZE +#define MAX_EGL_CACHE_ENTRY_SIZE (16 * 1024); +#endif + +#ifndef MAX_EGL_CACHE_SIZE +#define MAX_EGL_CACHE_SIZE (64 * 1024); +#endif + // Cache size limits. static const size_t maxKeySize = 1024; -static const size_t maxValueSize = 4096; -static const size_t maxTotalSize = 64 * 1024; +static const size_t maxValueSize = MAX_EGL_CACHE_ENTRY_SIZE; +static const size_t maxTotalSize = MAX_EGL_CACHE_SIZE; // Cache file header static const char* cacheFileMagic = "EGL$"; |