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

Unified Diff: ui/gl/gl_surface_egl.cc

Issue 2541843004: Add a version of gpu_fuzzer that is backed by the NULL ANGLE backend (Closed)
Patch Set: rebase + remove unneeded flags Created 4 years 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 | « gpu/command_buffer/tests/fuzzer_main.cc ('k') | no next file » | 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 56032ca958d5140d8845a549c95f0ffa1e2e1ae9..d0306b4412d6f182559901c2c0459c999b0a1238 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -154,11 +154,15 @@ EGLDisplay GetPlatformANGLEDisplay(EGLNativeDisplayType native_display,
}
#if defined(USE_X11) && !defined(OS_CHROMEOS)
- Visual* visual;
- ui::XVisualManager::GetInstance()->ChooseVisualForWindow(
- true, &visual, nullptr, nullptr, nullptr);
- display_attribs.push_back(EGL_X11_VISUAL_ID_ANGLE);
- display_attribs.push_back(static_cast<EGLint>(XVisualIDFromVisual(visual)));
+ // ANGLE_NULL doesn't use the visual, and may run without X11 where we can't
+ // get it anyway.
+ if (platform_type != EGL_PLATFORM_ANGLE_TYPE_NULL_ANGLE) {
+ Visual* visual;
+ ui::XVisualManager::GetInstance()->ChooseVisualForWindow(
+ true, &visual, nullptr, nullptr, nullptr);
+ display_attribs.push_back(EGL_X11_VISUAL_ID_ANGLE);
+ display_attribs.push_back(static_cast<EGLint>(XVisualIDFromVisual(visual)));
+ }
#endif
display_attribs.push_back(EGL_NONE);
@@ -249,9 +253,13 @@ EGLConfig ChooseConfig(GLSurface::Format format) {
EGLint alpha_size = 8;
#if defined(USE_X11) && !defined(OS_CHROMEOS)
- ui::XVisualManager::GetInstance()->ChooseVisualForWindow(
- true, nullptr, &buffer_size, nullptr, nullptr);
- alpha_size = buffer_size == 32 ? 8 : 0;
+ // If we're using ANGLE_NULL, we may not have a display, in which case we
+ // can't use XVisualManager.
+ if (g_native_display) {
+ ui::XVisualManager::GetInstance()->ChooseVisualForWindow(
+ true, nullptr, &buffer_size, nullptr, nullptr);
+ alpha_size = buffer_size == 32 ? 8 : 0;
+ }
#endif
EGLint surface_type = (format == GLSurface::SURFACE_SURFACELESS)
« no previous file with comments | « gpu/command_buffer/tests/fuzzer_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698