summaryrefslogtreecommitdiffstats
path: root/opengl/libs/EGL/egl_cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'opengl/libs/EGL/egl_cache.h')
-rw-r--r--opengl/libs/EGL/egl_cache.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/opengl/libs/EGL/egl_cache.h b/opengl/libs/EGL/egl_cache.h
index 7021752..05d5873 100644
--- a/opengl/libs/EGL/egl_cache.h
+++ b/opengl/libs/EGL/egl_cache.h
@@ -21,6 +21,7 @@
#include <EGL/eglext.h>
#include <utils/BlobCache.h>
+#include <utils/String8.h>
#include <utils/StrongPointer.h>
// ----------------------------------------------------------------------------
@@ -29,7 +30,7 @@ namespace android {
class egl_display_t;
-class egl_cache_t {
+class EGLAPI egl_cache_t {
public:
// get returns a pointer to the singleton egl_cache_t object. This
@@ -60,6 +61,10 @@ public:
EGLsizei getBlob(const void* key, EGLsizei keySize, void* value,
EGLsizei valueSize);
+ // setCacheFilename sets the name of the file that should be used to store
+ // cache contents from one program invocation to another.
+ void setCacheFilename(const char* filename);
+
private:
// Creation and (the lack of) destruction is handled internally.
egl_cache_t();
@@ -96,9 +101,19 @@ private:
// first time it's needed.
sp<BlobCache> mBlobCache;
+ // mFilename is the name of the file for storing cache contents in between
+ // program invocations. It is initialized to an empty string at
+ // construction time, and can be set with the setCacheFilename method. An
+ // empty string indicates that the cache should not be saved to or restored
+ // from disk.
+ String8 mFilename;
+
// mMutex is the mutex used to prevent concurrent access to the member
// variables. It must be locked whenever the member variables are accessed.
mutable Mutex mMutex;
+
+ // sCache is the singleton egl_cache_t object.
+ static egl_cache_t sCache;
};
// ----------------------------------------------------------------------------