Index: ui/gl/gl_surface_egl.cc |
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc |
index 1d5c1409980618730e2f732cfd15b916bfeab6c6..9940b22856b523bd2052838deda6edc6a9c00b41 100644 |
--- a/ui/gl/gl_surface_egl.cc |
+++ b/ui/gl/gl_surface_egl.cc |
@@ -134,6 +134,7 @@ bool g_egl_sync_control_supported = false; |
bool g_egl_window_fixed_size_supported = false; |
bool g_egl_surfaceless_context_supported = false; |
bool g_egl_surface_orientation_supported = false; |
+bool g_egl_context_priority_supported = false; |
bool g_use_direct_composition = false; |
base::LazyInstance<ANGLEPlatformImpl> g_angle_platform_impl = |
@@ -242,6 +243,7 @@ bool ValidateEglConfig(EGLDisplay display, |
EGLConfig ChooseConfig(GLSurfaceFormat format) { |
// Choose an EGL configuration. |
// On X this is only used for PBuffer surfaces. |
+ |
std::vector<EGLint> renderable_types; |
if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kDisableES3GLContext)) { |
@@ -252,6 +254,9 @@ EGLConfig ChooseConfig(GLSurfaceFormat format) { |
EGLint buffer_size = format.GetBufferSize(); |
EGLint alpha_size = 8; |
bool want_rgb565 = buffer_size == 16; |
+ EGLint depth_size = format.GetDepthBits(); |
+ EGLint stencil_size = format.GetStencilBits(); |
+ EGLint samples = format.GetSamples(); |
#if defined(USE_X11) && !defined(OS_CHROMEOS) |
// If we're using ANGLE_NULL, we may not have a display, in which case we |
@@ -278,6 +283,12 @@ EGLConfig ChooseConfig(GLSurfaceFormat format) { |
8, |
EGL_RED_SIZE, |
8, |
+ EGL_SAMPLES, |
+ samples, |
+ EGL_DEPTH_SIZE, |
+ depth_size, |
+ EGL_STENCIL_SIZE, |
+ stencil_size, |
EGL_RENDERABLE_TYPE, |
renderable_type, |
EGL_SURFACE_TYPE, |
@@ -292,6 +303,12 @@ EGLConfig ChooseConfig(GLSurfaceFormat format) { |
6, |
EGL_RED_SIZE, |
5, |
+ EGL_SAMPLES, |
+ samples, |
+ EGL_DEPTH_SIZE, |
+ depth_size, |
+ EGL_STENCIL_SIZE, |
+ stencil_size, |
EGL_RENDERABLE_TYPE, |
renderable_type, |
EGL_SURFACE_TYPE, |
@@ -505,6 +522,13 @@ bool GLSurfaceEGL::InitializeOneOff(EGLNativeDisplayType native_display) { |
HasEGLExtension("EGL_ANGLE_window_fixed_size"); |
g_egl_surface_orientation_supported = |
HasEGLExtension("EGL_ANGLE_surface_orientation"); |
+ // TODO(klausw): According to |
+ // https://source.android.com/compatibility/android-cdd.html |
+ // the EGL_IMG_context_priority extension is mandatory for |
+ // Virtual Reality High Performance support, but it's not |
+ // showing in the list of reported EGL extensions? |
+ g_egl_context_priority_supported = |
+ HasEGLExtension("EGL_IMG_context_priority"); |
// Need EGL_ANGLE_flexible_surface_compatibility to allow surfaces with and |
// without alpha to be bound to the same context. |
@@ -609,6 +633,11 @@ bool GLSurfaceEGL::IsEGLSurfacelessContextSupported() { |
} |
// static |
+bool GLSurfaceEGL::IsEGLContextPrioritySupported() { |
+ return g_egl_context_priority_supported; |
+} |
+ |
+// static |
bool GLSurfaceEGL::IsDirectCompositionSupported() { |
return g_use_direct_composition; |
} |