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

Unified Diff: ui/gl/gl_surface_egl.cc

Issue 2461803002: Enable creation of offscreen contexts which own their backing surface. (Closed)
Patch Set: Drop unnecessary dependent patch Created 4 years, 1 month 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
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,

Powered by Google App Engine
This is Rietveld 408576698