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

Unified Diff: ui/gl/gl_surface_egl.cc

Issue 1738973004: Fix EGL configs with GLSurfaceOzoneSurfaceless. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only for surfaceless. Created 4 years, 9 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 | « no previous file | ui/gl/gl_surface_ozone.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 8c3ed9fa9b876ae50090713841424278b44db784..a444ab1fb45c4bf7754de4c9989742c00cdae0b7 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -251,11 +251,12 @@ bool ValidateEglConfig(EGLDisplay display,
return true;
}
-EGLConfig ChooseConfig(GLSurface::Format format) {
- static std::map<GLSurface::Format, EGLConfig> config_map;
+EGLConfig ChooseConfig(GLSurface::Format format, bool is_surfaceless) {
+ static std::map<std::pair<GLSurface::Format, bool>, EGLConfig> config_map;
no sievers 2016/03/08 22:02:00 It seems odd that surfaceless even cares about |Fo
kylechar 2016/03/09 15:07:30 This is all sort of black magic to me (and documen
- if (config_map.find(format) != config_map.end()) {
- return config_map[format];
+ auto config_type = std::make_pair(format, is_surfaceless);
+ if (config_map.find(config_type) != config_map.end()) {
+ return config_map[config_type];
}
// Choose an EGL configuration.
@@ -283,6 +284,9 @@ EGLConfig ChooseConfig(GLSurface::Format format) {
}
#endif
+ EGLint surface_type =
+ is_surfaceless ? EGL_DONT_CARE : EGL_WINDOW_BIT | EGL_PBUFFER_BIT;
+
EGLint config_attribs_8888[] = {
EGL_BUFFER_SIZE, buffer_size,
EGL_ALPHA_SIZE, alpha_size,
@@ -290,7 +294,7 @@ EGLConfig ChooseConfig(GLSurface::Format format) {
EGL_GREEN_SIZE, 8,
EGL_RED_SIZE, 8,
EGL_RENDERABLE_TYPE, renderable_type,
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT,
+ EGL_SURFACE_TYPE, surface_type,
EGL_NONE
};
@@ -301,7 +305,7 @@ EGLConfig ChooseConfig(GLSurface::Format format) {
EGL_GREEN_SIZE, 6,
EGL_RED_SIZE, 5,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT,
+ EGL_SURFACE_TYPE, surface_type,
EGL_NONE
};
if (format == GLSurface::SURFACE_RGB565) {
@@ -374,7 +378,7 @@ EGLConfig ChooseConfig(GLSurface::Format format) {
}
}
}
- config_map[format] = config;
+ config_map[config_type] = config;
return config;
}
@@ -506,7 +510,7 @@ EGLDisplay GLSurfaceEGL::GetDisplay() {
EGLConfig GLSurfaceEGL::GetConfig() {
if (!config_) {
- config_ = ChooseConfig(format_);
+ config_ = ChooseConfig(format_, IsSurfaceless());
}
return config_;
}
« no previous file with comments | « no previous file | ui/gl/gl_surface_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698