| 38 | } |
| 39 | |
| 40 | Status CreateContext(EGLDisplay display, EGLContext shared_context, |
| 41 | EGLConfig config, EglContext* egl_context) { |
| 42 | static const EGLint attributes[] = {EGL_CONTEXT_CLIENT_VERSION, 3, |
| 43 | #ifdef _DEBUG // Add debugging bit |
| 44 | EGL_CONTEXT_FLAGS_KHR, |
| 45 | EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR, |
| 46 | #endif |
| 47 | EGL_NONE}; |
| 48 | EGLContext context = |
| 49 | eglCreateContext(display, config, shared_context, attributes); |
| 50 | RETURN_IF_ERROR(GetOpenGlErrors()); |
| 51 | if (context == EGL_NO_CONTEXT) { |
| 52 | return InternalError("No EGL error, but eglCreateContext failed."); |
| 53 | } |
| 54 | *egl_context = EglContext(context, display, config, true); |
| 55 | return OkStatus(); |
| 56 | } |
| 57 | |
| 58 | bool HasExtension(EGLDisplay display, const char* name) { |
| 59 | return std::strstr(eglQueryString(display, EGL_EXTENSIONS), name); |
no test coverage detected