diff options
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 26e8c3e..b660c53 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 // ---------------------------------------------------------------------------- |