summaryrefslogtreecommitdiffstats
path: root/opengl/libs/EGL/egl_cache.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-02-13 17:09:30 -0800
committerMathias Agopian <mathias@google.com>2012-02-13 18:11:42 -0800
commit8db8509e3cfe63a05da5e990164ec3a4576528ca (patch)
tree454fa0e494c705566d984c0f515de50999f5d30f /opengl/libs/EGL/egl_cache.cpp
parentcb66aec0bdd3248c526c3a1113936576a30286cb (diff)
downloadframeworks_base-8db8509e3cfe63a05da5e990164ec3a4576528ca.zip
frameworks_base-8db8509e3cfe63a05da5e990164ec3a4576528ca.tar.gz
frameworks_base-8db8509e3cfe63a05da5e990164ec3a4576528ca.tar.bz2
remove multiplexing of multiple EGL implementation
from now on, the system can only have one EGL implementation. this means the software and h/w renderer cannot be used at the same time on a device. Of course, the h/w renderer is always prefered; in its absence we default to the software renderer. Change-Id: Ib579f58055dd0ce4c4a99144131efa11c16ca3d3
Diffstat (limited to 'opengl/libs/EGL/egl_cache.cpp')
-rw-r--r--opengl/libs/EGL/egl_cache.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/opengl/libs/EGL/egl_cache.cpp b/opengl/libs/EGL/egl_cache.cpp
index 7fd6519..c79fb5f 100644
--- a/opengl/libs/EGL/egl_cache.cpp
+++ b/opengl/libs/EGL/egl_cache.cpp
@@ -83,39 +83,39 @@ egl_cache_t* egl_cache_t::get() {
void egl_cache_t::initialize(egl_display_t *display) {
Mutex::Autolock lock(mMutex);
- for (int i = 0; i < IMPL_NUM_IMPLEMENTATIONS; i++) {
- egl_connection_t* const cnx = &gEGLImpl[i];
- if (cnx->dso && cnx->major >= 0 && cnx->minor >= 0) {
- const char* exts = display->disp[i].queryString.extensions;
- size_t bcExtLen = strlen(BC_EXT_STR);
- size_t extsLen = strlen(exts);
- bool equal = !strcmp(BC_EXT_STR, exts);
- bool atStart = !strncmp(BC_EXT_STR " ", exts, bcExtLen+1);
- bool atEnd = (bcExtLen+1) < extsLen &&
- !strcmp(" " BC_EXT_STR, exts + extsLen - (bcExtLen+1));
- bool inMiddle = strstr(exts, " " BC_EXT_STR " ");
- if (equal || atStart || atEnd || inMiddle) {
- PFNEGLSETBLOBCACHEFUNCSANDROIDPROC eglSetBlobCacheFuncsANDROID;
- eglSetBlobCacheFuncsANDROID =
- reinterpret_cast<PFNEGLSETBLOBCACHEFUNCSANDROIDPROC>(
+
+ egl_connection_t* const cnx = &gEGLImpl;
+ if (cnx->dso && cnx->major >= 0 && cnx->minor >= 0) {
+ const char* exts = display->disp.queryString.extensions;
+ size_t bcExtLen = strlen(BC_EXT_STR);
+ size_t extsLen = strlen(exts);
+ bool equal = !strcmp(BC_EXT_STR, exts);
+ bool atStart = !strncmp(BC_EXT_STR " ", exts, bcExtLen+1);
+ bool atEnd = (bcExtLen+1) < extsLen &&
+ !strcmp(" " BC_EXT_STR, exts + extsLen - (bcExtLen+1));
+ bool inMiddle = strstr(exts, " " BC_EXT_STR " ");
+ if (equal || atStart || atEnd || inMiddle) {
+ PFNEGLSETBLOBCACHEFUNCSANDROIDPROC eglSetBlobCacheFuncsANDROID;
+ eglSetBlobCacheFuncsANDROID =
+ reinterpret_cast<PFNEGLSETBLOBCACHEFUNCSANDROIDPROC>(
cnx->egl.eglGetProcAddress(
"eglSetBlobCacheFuncsANDROID"));
- if (eglSetBlobCacheFuncsANDROID == NULL) {
- ALOGE("EGL_ANDROID_blob_cache advertised by display %d, "
- "but unable to get eglSetBlobCacheFuncsANDROID", i);
- continue;
- }
+ if (eglSetBlobCacheFuncsANDROID == NULL) {
+ ALOGE("EGL_ANDROID_blob_cache advertised, "
+ "but unable to get eglSetBlobCacheFuncsANDROID");
+ return;
+ }
- eglSetBlobCacheFuncsANDROID(display->disp[i].dpy,
- android::setBlob, android::getBlob);
- EGLint err = cnx->egl.eglGetError();
- if (err != EGL_SUCCESS) {
- ALOGE("eglSetBlobCacheFuncsANDROID resulted in an error: "
- "%#x", err);
- }
+ eglSetBlobCacheFuncsANDROID(display->disp.dpy,
+ android::setBlob, android::getBlob);
+ EGLint err = cnx->egl.eglGetError();
+ if (err != EGL_SUCCESS) {
+ ALOGE("eglSetBlobCacheFuncsANDROID resulted in an error: "
+ "%#x", err);
}
}
}
+
mInitialized = true;
}