Index: ui/gl/gl_surface_egl.cc |
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc |
index 0bce1d00911a2be32ed9ca1f70446fe8468112c5..a8b0efb966a297798d5fb931fa564ab4beaf19cf 100644 |
--- a/ui/gl/gl_surface_egl.cc |
+++ b/ui/gl/gl_surface_egl.cc |
@@ -241,6 +241,15 @@ EGLConfig ChooseConfig(GLSurface::Format format) { |
EGLint buffer_size = 32; |
EGLint alpha_size = 8; |
+ EGLint depth_size = EGL_DONT_CARE; |
+ |
+ if (format == GLSurface::SURFACE_ARGB8888_DEPTH24) { |
+ depth_size = 24; |
+ format = GLSurface::SURFACE_ARGB8888; |
+ } else if (format == GLSurface::SURFACE_RGB565_DEPTH24) { |
+ depth_size = 24; |
+ format = GLSurface::SURFACE_RGB565; |
+ } |
#if defined(USE_X11) && !defined(OS_CHROMEOS) |
ui::XVisualManager::GetInstance()->ChooseVisualForWindow( |
@@ -263,6 +272,8 @@ EGLConfig ChooseConfig(GLSurface::Format format) { |
8, |
EGL_RED_SIZE, |
8, |
+ EGL_DEPTH_SIZE, |
+ depth_size, |
EGL_RENDERABLE_TYPE, |
renderable_type, |
EGL_SURFACE_TYPE, |
@@ -277,6 +288,8 @@ EGLConfig ChooseConfig(GLSurface::Format format) { |
6, |
EGL_RED_SIZE, |
5, |
+ EGL_DEPTH_SIZE, |
+ depth_size, |
EGL_RENDERABLE_TYPE, |
renderable_type, |
EGL_SURFACE_TYPE, |