Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bace39e1 authored by Dan Willemsen's avatar Dan Willemsen
Browse files

Hardcode EGL Cache size to something more reasonable

Most of our devices are setting much larger values here than the
default, so instead of hoping every device sets the larger values, just
hardcode the cache size to the larger values.

This also reduces build-time configuration, so we can share the built
library between more devices.

Test: /data/nativetest*/EGL_test/EGL_test on aosp_flounder-eng
Change-Id: Id9b80cecff837cc35043ad3c3cf1d1c60595c237
parent 5e86147a
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -42,18 +42,6 @@ LOCAL_CFLAGS += -DLOG_TAG=\"libEGL\"
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
LOCAL_CFLAGS += -fvisibility=hidden

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

ifneq ($(filter address,$(SANITIZE_TARGET)),)
  LOCAL_CFLAGS_32 += -DEGL_WRAPPER_DIR=\"/$(TARGET_COPY_OUT_DATA)/lib\"
  LOCAL_CFLAGS_64 += -DEGL_WRAPPER_DIR=\"/$(TARGET_COPY_OUT_DATA)/lib64\"
+3 −15
Original line number Diff line number Diff line
@@ -27,22 +27,10 @@
#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_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 = MAX_EGL_CACHE_KEY_SIZE;
static const size_t maxValueSize = MAX_EGL_CACHE_ENTRY_SIZE;
static const size_t maxTotalSize = MAX_EGL_CACHE_SIZE;
static const size_t maxKeySize = 12 * 1024;
static const size_t maxValueSize = 64 * 1024;
static const size_t maxTotalSize = 2 * 1024 * 1024;

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