diff options
author | Mathias Agopian <mathias@google.com> | 2012-01-28 21:44:00 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2012-01-29 22:22:09 -0800 |
commit | ea261a2e13c23f641d6caa38ce8d9f5ad94504da (patch) | |
tree | d4f0df4e2f1f04d336eb5cdc2092b3af92b69572 /opengl/libs/EGL/egl_object.cpp | |
parent | dfbcee6cb8ab9cf89b9052eb7498e453afdb1463 (diff) |
add support for GL_EXT_debug_marker
This extension is always added to the GL_EXTENSIONS
extension string for the current GL context, regardless
of if it's supported by the h/w driver.
The extension itself will be handled by GLES_trace (eventually),
when GLES_trace is not enabled, it'll result to a no-op.
If the h/w implementation has this extension, we'll call that version
instead of our dummy version.
Change-Id: Ie5dd3387c4d45cd5ed5f03b73bda6045620a96bc
Diffstat (limited to 'opengl/libs/EGL/egl_object.cpp')
-rw-r--r-- | opengl/libs/EGL/egl_object.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/opengl/libs/EGL/egl_object.cpp b/opengl/libs/EGL/egl_object.cpp index 26e8c3eb10c4..b660c53142ac 100644 --- a/opengl/libs/EGL/egl_object.cpp +++ b/opengl/libs/EGL/egl_object.cpp @@ -62,5 +62,41 @@ bool egl_object_t::get(egl_display_t const* display, egl_object_t* object) { } // ---------------------------------------------------------------------------- + +egl_context_t::egl_context_t(EGLDisplay dpy, EGLContext context, EGLConfig config, + int impl, egl_connection_t const* cnx, int version) : + egl_object_t(get_display(dpy)), dpy(dpy), context(context), + config(config), read(0), draw(0), impl(impl), cnx(cnx), + version(version) +{ +} + +void egl_context_t::onLooseCurrent() { + read = NULL; + draw = NULL; +} + +void egl_context_t::onMakeCurrent(EGLSurface draw, EGLSurface read) { + this->read = read; + this->draw = draw; + + /* + * Here we cache the GL_EXTENSIONS string for this context and we + * add the extensions always handled by the wrapper + */ + + if (gl_extensions.isEmpty()) { + // call the implementation's glGetString(GL_EXTENSIONS) + const char* exts = (const char *)gEGLImpl[impl].hooks[version]->gl.glGetString(GL_EXTENSIONS); + gl_extensions.setTo(exts); + if (gl_extensions.find("GL_EXT_debug_marker") < 0) { + String8 temp("GL_EXT_debug_marker "); + temp.append(gl_extensions); + gl_extensions.setTo(temp); + } + } +} + +// ---------------------------------------------------------------------------- }; // namespace android // ---------------------------------------------------------------------------- |