Skip to content

Commit b8d20d0

Browse files
Jamie GennisAndroid (Google) Code Review
authored andcommitted
Merge "EGL: Use cache sizes defined in the BoardConfig" into ics-mr1
2 parents 53cf202 + 6f0f0b1 commit b8d20d0

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

opengl/libs/Android.mk

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,17 @@ ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
4444
LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
4545
endif
4646

47+
ifneq ($(MAX_EGL_CACHE_ENTRY_SIZE),)
48+
LOCAL_CFLAGS += -DMAX_EGL_CACHE_ENTRY_SIZE=$(MAX_EGL_CACHE_ENTRY_SIZE)
49+
endif
50+
51+
ifneq ($(MAX_EGL_CACHE_SIZE),)
52+
LOCAL_CFLAGS += -DMAX_EGL_CACHE_SIZE=$(MAX_EGL_CACHE_SIZE)
53+
endif
54+
4755
include $(BUILD_SHARED_LIBRARY)
4856
installed_libEGL := $(LOCAL_INSTALLED_MODULE)
4957

50-
5158
# OpenGL drivers config file
5259
ifneq ($(BOARD_EGL_CFG),)
5360

opengl/libs/EGL/egl_cache.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,18 @@
2525
#include <sys/types.h>
2626
#include <unistd.h>
2727

28+
#ifndef MAX_EGL_CACHE_ENTRY_SIZE
29+
#define MAX_EGL_CACHE_ENTRY_SIZE (16 * 1024);
30+
#endif
31+
32+
#ifndef MAX_EGL_CACHE_SIZE
33+
#define MAX_EGL_CACHE_SIZE (64 * 1024);
34+
#endif
35+
2836
// Cache size limits.
2937
static const size_t maxKeySize = 1024;
30-
static const size_t maxValueSize = 4096;
31-
static const size_t maxTotalSize = 64 * 1024;
38+
static const size_t maxValueSize = MAX_EGL_CACHE_ENTRY_SIZE;
39+
static const size_t maxTotalSize = MAX_EGL_CACHE_SIZE;
3240

3341
// Cache file header
3442
static const char* cacheFileMagic = "EGL$";

0 commit comments

Comments
 (0)