summaryrefslogtreecommitdiffstats
path: root/opengl/libs/EGL/egl.cpp
diff options
context:
space:
mode:
authorDavid Li <davidxli@google.com>2011-03-28 10:39:28 -0700
committerDavid Li <davidxli@google.com>2011-04-12 15:56:10 -0700
commitce30eb8a90a1ac458e15e773057a8a73b0918ae6 (patch)
tree4d05f2d2d27641e264d59249355597d4c2a4d3a7 /opengl/libs/EGL/egl.cpp
parent2e3ede527d8a972795a49ffc7eef4ead391107ec (diff)
downloadframeworks_base-ce30eb8a90a1ac458e15e773057a8a73b0918ae6.zip
frameworks_base-ce30eb8a90a1ac458e15e773057a8a73b0918ae6.tar.gz
frameworks_base-ce30eb8a90a1ac458e15e773057a8a73b0918ae6.tar.bz2
GLES2Dbg: change GLES2_dbg to shared library
Change-Id: I493e9bff431bd939f4e80e1e9c614dd557307fa2 Signed-off-by: David Li <davidxli@google.com>
Diffstat (limited to 'opengl/libs/EGL/egl.cpp')
-rw-r--r--opengl/libs/EGL/egl.cpp37
1 files changed, 11 insertions, 26 deletions
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index 6474c87..7183e83 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -46,6 +46,7 @@
#include "egl_impl.h"
#include "Loader.h"
#include "glesv2dbg.h"
+#include "egl_tls.h"
#define setError(_e, _r) setErrorEtc(__FUNCTION__, __LINE__, _e, _r)
@@ -58,7 +59,7 @@ namespace android {
static char const * const gVendorString = "Android";
static char const * const gVersionString = "1.4 Android META-EGL";
static char const * const gClientApiString = "OpenGL ES";
-static char const * const gExtensionString =
+static char const * const gExtensionString =
"EGL_KHR_image "
"EGL_KHR_image_base "
"EGL_KHR_image_pixmap "
@@ -221,18 +222,15 @@ struct egl_surface_t : public egl_object_t
struct egl_context_t : public egl_object_t
{
typedef egl_object_t::LocalRef<egl_context_t, EGLContext> Ref;
-
+
egl_context_t(EGLDisplay dpy, EGLContext context, EGLConfig config,
- int impl, egl_connection_t const* cnx, int version)
- : egl_object_t(dpy), dpy(dpy), context(context), config(config), read(0), draw(0),
- impl(impl), cnx(cnx), version(version), dbg(NULL)
+ int impl, egl_connection_t const* cnx, int version)
+ : egl_object_t(dpy), dpy(dpy), context(context), config(config), read(0), draw(0),
+ impl(impl), cnx(cnx), version(version)
{
}
~egl_context_t()
{
- if (dbg)
- DestroyDbgContext(dbg);
- dbg = NULL;
}
EGLDisplay dpy;
EGLContext context;
@@ -242,7 +240,6 @@ struct egl_context_t : public egl_object_t
int impl;
egl_connection_t const* cnx;
int version;
- DbgContext * dbg;
};
struct egl_image_t : public egl_object_t
@@ -277,15 +274,6 @@ typedef egl_context_t::Ref ContextRef;
typedef egl_image_t::Ref ImageRef;
typedef egl_sync_t::Ref SyncRef;
-struct tls_t
-{
- tls_t() : error(EGL_SUCCESS), ctx(0), logCallWithNoContext(EGL_TRUE) { }
- EGLint error;
- EGLContext ctx;
- EGLBoolean logCallWithNoContext;
-};
-
-
// ----------------------------------------------------------------------------
static egl_connection_t gEGLImpl[IMPL_NUM_IMPLEMENTATIONS];
@@ -586,7 +574,7 @@ static inline NATIVE* egl_to_native_cast(EGL arg) {
}
static inline
-egl_surface_t* get_surface(EGLSurface surface) {
+egl_surface_t* get_surface(EGLSurface surface) {
return egl_to_native_cast<egl_surface_t>(surface);
}
@@ -595,11 +583,6 @@ egl_context_t* get_context(EGLContext context) {
return egl_to_native_cast<egl_context_t>(context);
}
-DbgContext * getDbgContextThreadSpecific()
-{
- return get_context(getContext())->dbg;
-}
-
static inline
egl_image_t* get_image(EGLImageKHR image) {
return egl_to_native_cast<egl_image_t>(image);
@@ -1442,10 +1425,12 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw,
loseCurrent(cur_c);
if (ctx != EGL_NO_CONTEXT) {
- if (!c->dbg && gEGLDebugLevel > 0)
- c->dbg = CreateDbgContext(c->version, c->cnx->hooks[c->version]);
setGLHooksThreadSpecific(c->cnx->hooks[c->version]);
setContext(ctx);
+ tls_t * const tls = getTLS();
+ if (!tls->dbg && gEGLDebugLevel > 0)
+ tls->dbg = CreateDbgContext(gEGLThreadLocalStorageKey, c->version,
+ c->cnx->hooks[c->version]);
_c.acquire();
_r.acquire();
_d.acquire();