From b7928463a32092940dd56b0694a624c21d18325d Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Wed, 9 Nov 2011 15:35:34 -0800 Subject: EGL: add the ANDROID suffix to the blob cache ext This change adds the ANDROID suffix to the all the types and functions defined by the EGL_ANDROID_blob_cache extension. Change-Id: I087875b96d9a7053efb9c8d5614f9f765eed799d --- opengl/libs/EGL/eglApi.cpp | 2 +- opengl/libs/EGL/egl_cache.cpp | 40 +++++++++++++++++++++------------------- opengl/libs/EGL/egl_cache.h | 8 ++++---- 3 files changed, 26 insertions(+), 24 deletions(-) (limited to 'opengl/libs') diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index 60ac34b..63f02e4 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -860,7 +860,7 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname) // The EGL_ANDROID_blob_cache extension should not be exposed to // applications. It is used internally by the Android EGL layer. - if (!strcmp(procname, "eglSetBlobCacheFuncs")) { + if (!strcmp(procname, "eglSetBlobCacheFuncsANDROID")) { return NULL; } diff --git a/opengl/libs/EGL/egl_cache.cpp b/opengl/libs/EGL/egl_cache.cpp index 522421b..13a4929 100644 --- a/opengl/libs/EGL/egl_cache.cpp +++ b/opengl/libs/EGL/egl_cache.cpp @@ -46,13 +46,13 @@ namespace android { // // Callback functions passed to EGL. // -static void setBlob(const void* key, EGLsizei keySize, const void* value, - EGLsizei valueSize) { +static void setBlob(const void* key, EGLsizeiANDROID keySize, + const void* value, EGLsizeiANDROID valueSize) { egl_cache_t::get()->setBlob(key, keySize, value, valueSize); } -static EGLsizei getBlob(const void* key, EGLsizei keySize, void* value, - EGLsizei valueSize) { +static EGLsizeiANDROID getBlob(const void* key, EGLsizeiANDROID keySize, + void* value, EGLsizeiANDROID valueSize) { return egl_cache_t::get()->getBlob(key, keySize, value, valueSize); } @@ -87,22 +87,23 @@ void egl_cache_t::initialize(egl_display_t *display) { !strcmp(" " BC_EXT_STR, exts + extsLen - (bcExtLen+1)); bool inMiddle = strstr(" " BC_EXT_STR " ", exts); if (equal || atStart || atEnd || inMiddle) { - PFNEGLSETBLOBCACHEFUNCSPROC eglSetBlobCacheFuncs; - eglSetBlobCacheFuncs = - reinterpret_cast( - cnx->egl.eglGetProcAddress("eglSetBlobCacheFuncs")); - if (eglSetBlobCacheFuncs == NULL) { + PFNEGLSETBLOBCACHEFUNCSANDROIDPROC eglSetBlobCacheFuncsANDROID; + eglSetBlobCacheFuncsANDROID = + reinterpret_cast( + cnx->egl.eglGetProcAddress( + "eglSetBlobCacheFuncsANDROID")); + if (eglSetBlobCacheFuncsANDROID == NULL) { LOGE("EGL_ANDROID_blob_cache advertised by display %d, " - "but unable to get eglSetBlobCacheFuncs", i); + "but unable to get eglSetBlobCacheFuncsANDROID", i); continue; } - eglSetBlobCacheFuncs(display->disp[i].dpy, android::setBlob, - android::getBlob); + eglSetBlobCacheFuncsANDROID(display->disp[i].dpy, + android::setBlob, android::getBlob); EGLint err = cnx->egl.eglGetError(); if (err != EGL_SUCCESS) { - LOGE("eglSetBlobCacheFuncs resulted in an error: %#x", - err); + LOGE("eglSetBlobCacheFuncsANDROID resulted in an error: " + "%#x", err); } } } @@ -119,8 +120,8 @@ void egl_cache_t::terminate() { mInitialized = false; } -void egl_cache_t::setBlob(const void* key, EGLsizei keySize, const void* value, - EGLsizei valueSize) { +void egl_cache_t::setBlob(const void* key, EGLsizeiANDROID keySize, + const void* value, EGLsizeiANDROID valueSize) { Mutex::Autolock lock(mMutex); if (keySize < 0 || valueSize < 0) { @@ -158,8 +159,8 @@ void egl_cache_t::setBlob(const void* key, EGLsizei keySize, const void* value, } } -EGLsizei egl_cache_t::getBlob(const void* key, EGLsizei keySize, void* value, - EGLsizei valueSize) { +EGLsizeiANDROID egl_cache_t::getBlob(const void* key, EGLsizeiANDROID keySize, + void* value, EGLsizeiANDROID valueSize) { Mutex::Autolock lock(mMutex); if (keySize < 0 || valueSize < 0) { @@ -323,7 +324,8 @@ void egl_cache_t::loadBlobCacheLocked() { return; } - status_t err = mBlobCache->unflatten(buf + headerSize, cacheSize, NULL, 0); + status_t err = mBlobCache->unflatten(buf + headerSize, cacheSize, NULL, + 0); if (err != OK) { LOGE("error reading cache contents: %s (%d)", strerror(-err), -err); diff --git a/opengl/libs/EGL/egl_cache.h b/opengl/libs/EGL/egl_cache.h index 4389623..8760009 100644 --- a/opengl/libs/EGL/egl_cache.h +++ b/opengl/libs/EGL/egl_cache.h @@ -52,14 +52,14 @@ public: // setBlob attempts to insert a new key/value blob pair into the cache. // This will be called by the hardware vendor's EGL implementation via the // EGL_ANDROID_blob_cache extension. - void setBlob(const void* key, EGLsizei keySize, const void* value, - EGLsizei valueSize); + void setBlob(const void* key, EGLsizeiANDROID keySize, const void* value, + EGLsizeiANDROID valueSize); // getBlob attempts to retrieve the value blob associated with a given key // blob from cache. This will be called by the hardware vendor's EGL // implementation via the EGL_ANDROID_blob_cache extension. - EGLsizei getBlob(const void* key, EGLsizei keySize, void* value, - EGLsizei valueSize); + EGLsizeiANDROID getBlob(const void* key, EGLsizeiANDROID keySize, + void* value, EGLsizeiANDROID valueSize); // setCacheFilename sets the name of the file that should be used to store // cache contents from one program invocation to another. -- cgit v1.1