| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gl/init/gl_factory.h" | 5 #include "ui/gl/init/gl_factory.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 std::string requested_implementation_name = | 36 std::string requested_implementation_name = |
| 37 cmd->GetSwitchValueASCII(switches::kUseGL); | 37 cmd->GetSwitchValueASCII(switches::kUseGL); |
| 38 if (requested_implementation_name == "any") { | 38 if (requested_implementation_name == "any") { |
| 39 fallback_to_osmesa = true; | 39 fallback_to_osmesa = true; |
| 40 } else if (requested_implementation_name == | 40 } else if (requested_implementation_name == |
| 41 kGLImplementationSwiftShaderName || | 41 kGLImplementationSwiftShaderName || |
| 42 requested_implementation_name == kGLImplementationANGLEName) { | 42 requested_implementation_name == kGLImplementationANGLEName) { |
| 43 impl = kGLImplementationEGLGLES2; | 43 impl = kGLImplementationEGLGLES2; |
| 44 } else { | 44 } else { |
| 45 impl = GetNamedGLImplementation(requested_implementation_name); | 45 impl = GetNamedGLImplementation(requested_implementation_name); |
| 46 if (!ContainsValue(allowed_impls, impl)) { | 46 if (!base::ContainsValue(allowed_impls, impl)) { |
| 47 LOG(ERROR) << "Requested GL implementation is not available."; | 47 LOG(ERROR) << "Requested GL implementation is not available."; |
| 48 return false; | 48 return false; |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool gpu_service_logging = cmd->HasSwitch(switches::kEnableGPUServiceLogging); | 53 bool gpu_service_logging = cmd->HasSwitch(switches::kEnableGPUServiceLogging); |
| 54 bool disable_gl_drawing = cmd->HasSwitch(switches::kDisableGLDrawingForTests); | 54 bool disable_gl_drawing = cmd->HasSwitch(switches::kDisableGLDrawingForTests); |
| 55 | 55 |
| 56 return InitializeGLOneOffImplementation( | 56 return InitializeGLOneOffImplementation( |
| (...skipping 27 matching lines...) Expand all Loading... |
| 84 | 84 |
| 85 void ClearGLBindings() { | 85 void ClearGLBindings() { |
| 86 ClearGLBindingsPlatform(); | 86 ClearGLBindingsPlatform(); |
| 87 | 87 |
| 88 SetGLImplementation(kGLImplementationNone); | 88 SetGLImplementation(kGLImplementationNone); |
| 89 UnloadGLNativeLibraries(); | 89 UnloadGLNativeLibraries(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace init | 92 } // namespace init |
| 93 } // namespace gl | 93 } // namespace gl |
| OLD | NEW |