Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: ui/gl/gl_surface_egl.cc

Issue 10822029: Use EXT_robustness where available on GLES2 platforms to detect and respond to resets of the graphi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review feedback. Rebuilt and re-tested. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_surface_egl.h ('k') | ui/gl/gl_surface_glx.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_egl.cc
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index a1214cf488bc17e7d1877e5a5d74e06b35615244..c1d8af1bf052169a424b5ab20b53a95120eeacd1 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -26,12 +26,17 @@ extern "C" {
namespace gfx {
namespace {
+
EGLConfig g_config;
EGLDisplay g_display;
EGLNativeDisplayType g_native_display;
EGLConfig g_software_config;
EGLDisplay g_software_display;
EGLNativeDisplayType g_software_native_display;
+
+const char* g_egl_extensions = NULL;
+bool g_egl_create_context_robustness_supported = false;
+
}
GLSurfaceEGL::GLSurfaceEGL() : software_(false) {}
@@ -96,6 +101,10 @@ bool GLSurfaceEGL::InitializeOneOff() {
return false;
}
+ g_egl_extensions = eglQueryString(g_display, EGL_EXTENSIONS);
+ g_egl_create_context_robustness_supported =
+ HasEGLExtension("EGL_EXT_create_context_robustness");
+
initialized = true;
#if defined(USE_X11) || defined(OS_ANDROID)
@@ -154,6 +163,18 @@ EGLNativeDisplayType GLSurfaceEGL::GetNativeDisplay() {
return g_native_display;
}
+const char* GLSurfaceEGL::GetEGLExtensions() {
+ return g_egl_extensions;
+}
+
+bool GLSurfaceEGL::HasEGLExtension(const char* name) {
+ return ExtensionsContain(GetEGLExtensions(), name);
+}
+
+bool GLSurfaceEGL::IsCreateContextRobustnessSupported() {
+ return g_egl_create_context_robustness_supported;
+}
+
GLSurfaceEGL::~GLSurfaceEGL() {}
NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(bool software,
« no previous file with comments | « ui/gl/gl_surface_egl.h ('k') | ui/gl/gl_surface_glx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698