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

Unified Diff: ui/gl/init/gl_factory.cc

Issue 2690113010: Abstract OSMesa from the Layout tests (Closed)
Patch Set: Fixed test code 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/init/gl_factory.cc
diff --git a/ui/gl/init/gl_factory.cc b/ui/gl/init/gl_factory.cc
index 376ab44952cc30137ecf5865aef88e6921eef7f3..e914a744fac3910171f0e9402d3fc2eb1326ba38 100644
--- a/ui/gl/init/gl_factory.cc
+++ b/ui/gl/init/gl_factory.cc
@@ -29,14 +29,14 @@ bool InitializeGLOneOff() {
// The default implementation is always the first one in list.
GLImplementation impl = allowed_impls[0];
- bool fallback_to_osmesa = false;
- if (cmd->HasSwitch(switches::kOverrideUseGLWithOSMesaForTests)) {
- impl = kGLImplementationOSMesaGL;
+ bool fallback_to_software_rendering = false;
Ken Russell (switch to Gerrit) 2017/02/15 02:32:15 Could you call this fallback_to_software_gl?
+ if (cmd->HasSwitch(switches::kOverrideUseSoftwareGLForTests)) {
+ impl = GetSoftwareGLImplementation();
} else if (cmd->HasSwitch(switches::kUseGL)) {
std::string requested_implementation_name =
cmd->GetSwitchValueASCII(switches::kUseGL);
if (requested_implementation_name == "any") {
- fallback_to_osmesa = true;
+ fallback_to_software_rendering = true;
} else if (requested_implementation_name ==
kGLImplementationSwiftShaderName) {
impl = kGLImplementationSwiftShaderGL;
@@ -56,19 +56,20 @@ bool InitializeGLOneOff() {
bool gpu_service_logging = cmd->HasSwitch(switches::kEnableGPUServiceLogging);
bool disable_gl_drawing = cmd->HasSwitch(switches::kDisableGLDrawingForTests);
- return InitializeGLOneOffImplementation(
- impl, fallback_to_osmesa, gpu_service_logging, disable_gl_drawing);
+ return InitializeGLOneOffImplementation(impl, fallback_to_software_rendering,
+ gpu_service_logging,
+ disable_gl_drawing);
}
bool InitializeGLOneOffImplementation(GLImplementation impl,
- bool fallback_to_osmesa,
+ bool fallback_to_software_rendering,
bool gpu_service_logging,
bool disable_gl_drawing) {
bool initialized =
InitializeStaticGLBindings(impl) && InitializeGLOneOffPlatform();
- if (!initialized && fallback_to_osmesa) {
+ if (!initialized && fallback_to_software_rendering) {
ShutdownGL();
- initialized = InitializeStaticGLBindings(kGLImplementationOSMesaGL) &&
+ initialized = InitializeStaticGLBindings(GetSoftwareGLImplementation()) &&
InitializeGLOneOffPlatform();
}
if (!initialized)

Powered by Google App Engine
This is Rietveld 408576698