| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/test/gl_surface_test_support.h" | 5 #include "ui/gl/test/gl_surface_test_support.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 // static | 66 // static |
| 67 void GLSurfaceTestSupport::InitializeOneOffImplementation( | 67 void GLSurfaceTestSupport::InitializeOneOffImplementation( |
| 68 GLImplementation impl, | 68 GLImplementation impl, |
| 69 bool fallback_to_osmesa) { | 69 bool fallback_to_osmesa) { |
| 70 DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) | 70 DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) |
| 71 << "kUseGL has not effect in tests"; | 71 << "kUseGL has not effect in tests"; |
| 72 | 72 |
| 73 // This method may be called multiple times in the same process to set up | 73 // This method may be called multiple times in the same process to set up |
| 74 // bindings in different ways. | 74 // bindings in different ways. |
| 75 ClearGLBindings(); | 75 init::ClearGLBindings(); |
| 76 | 76 |
| 77 bool gpu_service_logging = false; | 77 bool gpu_service_logging = false; |
| 78 bool disable_gl_drawing = false; | 78 bool disable_gl_drawing = false; |
| 79 | 79 |
| 80 CHECK(init::InitializeGLOneOffImplementation( | 80 CHECK(init::InitializeGLOneOffImplementation( |
| 81 impl, fallback_to_osmesa, gpu_service_logging, disable_gl_drawing)); | 81 impl, fallback_to_osmesa, gpu_service_logging, disable_gl_drawing)); |
| 82 } | 82 } |
| 83 | 83 |
| 84 // static | 84 // static |
| 85 void GLSurfaceTestSupport::InitializeOneOffWithMockBindings() { | 85 void GLSurfaceTestSupport::InitializeOneOffWithMockBindings() { |
| 86 InitializeOneOffImplementation(kGLImplementationMockGL, false); | 86 InitializeOneOffImplementation(kGLImplementationMockGL, false); |
| 87 } | 87 } |
| 88 | 88 |
| 89 // static | 89 // static |
| 90 void GLSurfaceTestSupport::InitializeDynamicMockBindings(GLContext* context) { | 90 void GLSurfaceTestSupport::InitializeDynamicMockBindings(GLContext* context) { |
| 91 CHECK(InitializeDynamicGLBindings(kGLImplementationMockGL, context)); | 91 CHECK(InitializeDynamicGLBindings(kGLImplementationMockGL, context)); |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace gl | 94 } // namespace gl |
| OLD | NEW |