summaryrefslogtreecommitdiff
path: root/host
diff options
context:
space:
mode:
authorLingfeng Yang <lfy@google.com>2017-07-27 18:46:11 -0700
committerGreg Hartman <ghartman@google.com>2018-08-23 17:30:51 -0700
commitc6c68a47732160318674cb8b1657c1c3564fa91f (patch)
tree85c5f92625e7f12bf1641c2be24892cb02df0deb /host
parent1a568aee115f89a2d2514ec42c6441ee8a9be014 (diff)
downloadopengl-transport-c6c68a47732160318674cb8b1657c1c3564fa91f.tar.gz
[gl][snapshot] Use LazyLoadedEGLDispatch
Instead of duplicating the functionality of it. +fix build break on Mac due to non-void function with blank return Change-Id: If3159c23a4957f7cd3418ad1f435d06b7d019bdb
Diffstat (limited to 'host')
-rw-r--r--host/libs/virglrenderer/OpenGLESDispatch/EGLDispatch.cpp17
-rw-r--r--host/libs/virglrenderer/OpenGLESDispatch/GLESv1Dispatch.cpp2
-rw-r--r--host/libs/virglrenderer/OpenGLESDispatch/GLESv3Dispatch.cpp2
3 files changed, 0 insertions, 21 deletions
diff --git a/host/libs/virglrenderer/OpenGLESDispatch/EGLDispatch.cpp b/host/libs/virglrenderer/OpenGLESDispatch/EGLDispatch.cpp
index 5b64ba5c0..f3de1bff6 100644
--- a/host/libs/virglrenderer/OpenGLESDispatch/EGLDispatch.cpp
+++ b/host/libs/virglrenderer/OpenGLESDispatch/EGLDispatch.cpp
@@ -15,9 +15,6 @@
*/
#include "OpenGLESDispatch/EGLDispatch.h"
-#include "android/base/synchronization/Lock.h"
-#include "android/base/memory/LazyInstance.h"
-
#include "emugl/common/shared_library.h"
#include <stdio.h>
@@ -40,19 +37,7 @@ EGLDispatch s_egl;
if (!s_egl.function_name || !s_egl.eglGetProcAddress) \
RENDER_EGL_LOAD_FIELD(return_type, function_name, signature)
-struct AsyncEGLInitData {
- bool initialized = false;
- android::base::Lock lock;
-};
-
-static android::base::LazyInstance<AsyncEGLInitData> sInitData =
- LAZY_INSTANCE_INIT;
-
bool init_egl_dispatch() {
- android::base::AutoLock lock(sInitData->lock);
-
- if (sInitData->initialized) return true;
-
const char *libName = getenv("ANDROID_EGL_LIB");
if (!libName) libName = DEFAULT_EGL_LIB;
char error[256];
@@ -67,7 +52,5 @@ bool init_egl_dispatch() {
LIST_RENDER_EGL_EXTENSIONS_FUNCTIONS(RENDER_EGL_LOAD_OPTIONAL_FIELD)
LIST_RENDER_EGL_SNAPSHOT_FUNCTIONS(RENDER_EGL_LOAD_FIELD)
- sInitData->initialized = true;
-
return true;
}
diff --git a/host/libs/virglrenderer/OpenGLESDispatch/GLESv1Dispatch.cpp b/host/libs/virglrenderer/OpenGLESDispatch/GLESv1Dispatch.cpp
index f40cb03ed..bda476c7f 100644
--- a/host/libs/virglrenderer/OpenGLESDispatch/GLESv1Dispatch.cpp
+++ b/host/libs/virglrenderer/OpenGLESDispatch/GLESv1Dispatch.cpp
@@ -14,7 +14,6 @@
* limitations under the License.
*/
#include "OpenGLESDispatch/GLESv1Dispatch.h"
-#include "OpenGLESDispatch/GLESv2Dispatch.h"
#include "OpenGLESDispatch/EGLDispatch.h"
@@ -116,7 +115,6 @@ LIST_GLES12_TR_FUNCTIONS(DEFINE_DUMMY_FUNCTION);
} while(0);
bool gles1_dispatch_init(GLESv1Dispatch* dispatch_table) {
- init_egl_dispatch();
dispatch_table->underlying_gles2_api = NULL;
diff --git a/host/libs/virglrenderer/OpenGLESDispatch/GLESv3Dispatch.cpp b/host/libs/virglrenderer/OpenGLESDispatch/GLESv3Dispatch.cpp
index 4aecc14d8..aadc7c9ba 100644
--- a/host/libs/virglrenderer/OpenGLESDispatch/GLESv3Dispatch.cpp
+++ b/host/libs/virglrenderer/OpenGLESDispatch/GLESv3Dispatch.cpp
@@ -44,8 +44,6 @@ static GLESDispatchMaxVersion s_max_supported_gles_version = GLES_DISPATCH_MAX_V
//
bool gles2_dispatch_init(GLESv2Dispatch* dispatch_table)
{
- init_egl_dispatch();
-
const char *libName = getenv("ANDROID_GLESv2_LIB");
if (!libName) {
libName = DEFAULT_GLES_V2_LIB;