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

Unified Diff: ui/gl/gl_surface_egl.cc

Issue 2698573002: Support offscreen contexts which own their backing surface (Closed)
Patch Set: Add missing alpha_size setting Created 3 years, 10 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
Index: ui/gl/gl_surface_egl.cc
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index 2e1cffffe094e5335e9f285a55457729134ea19b..fb97870cc94ceb51537ba60c1db8cc4fa30bfb06 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -242,6 +242,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 +253,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 +282,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 +302,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,

Powered by Google App Engine
This is Rietveld 408576698