From f478e6d18cb9eba1ded1f124ce16a899d271689e Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Wed, 12 Sep 2012 11:55:16 -0700 Subject: [PATCH] EGL: make max cache key size BoardConfig-able This change makes the maximum EGL blob cache key size configurable via a BoardConfig. Change-Id: Ic669cd25fc743662bd4f13aab62354fc3d54560c --- opengl/libs/Android.mk | 4 ++++ opengl/libs/EGL/egl_cache.cpp | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk index eea79f802..31bfcd7e7 100644 --- a/opengl/libs/Android.mk +++ b/opengl/libs/Android.mk @@ -57,6 +57,10 @@ ifneq ($(MAX_EGL_CACHE_ENTRY_SIZE),) LOCAL_CFLAGS += -DMAX_EGL_CACHE_ENTRY_SIZE=$(MAX_EGL_CACHE_ENTRY_SIZE) endif +ifneq ($(MAX_EGL_CACHE_KEY_SIZE),) + LOCAL_CFLAGS += -DMAX_EGL_CACHE_KEY_SIZE=$(MAX_EGL_CACHE_KEY_SIZE) +endif + ifneq ($(MAX_EGL_CACHE_SIZE),) LOCAL_CFLAGS += -DMAX_EGL_CACHE_SIZE=$(MAX_EGL_CACHE_SIZE) endif diff --git a/opengl/libs/EGL/egl_cache.cpp b/opengl/libs/EGL/egl_cache.cpp index ed2bef3d4..72655dfb5 100644 --- a/opengl/libs/EGL/egl_cache.cpp +++ b/opengl/libs/EGL/egl_cache.cpp @@ -29,12 +29,16 @@ #define MAX_EGL_CACHE_ENTRY_SIZE (16 * 1024); #endif +#ifndef MAX_EGL_CACHE_KEY_SIZE +#define MAX_EGL_CACHE_KEY_SIZE (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 maxKeySize = MAX_EGL_CACHE_KEY_SIZE; static const size_t maxValueSize = MAX_EGL_CACHE_ENTRY_SIZE; static const size_t maxTotalSize = MAX_EGL_CACHE_SIZE;