OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/gl_surface.h" | 5 #include "ui/gl/gl_surface.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 GLImplementation impl = allowed_impls[0]; | 121 GLImplementation impl = allowed_impls[0]; |
122 if (use_osmesa) | 122 if (use_osmesa) |
123 impl = kGLImplementationOSMesaGL; | 123 impl = kGLImplementationOSMesaGL; |
124 | 124 |
125 DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) | 125 DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) |
126 << "kUseGL has not effect in tests"; | 126 << "kUseGL has not effect in tests"; |
127 | 127 |
128 bool fallback_to_osmesa = false; | 128 bool fallback_to_osmesa = false; |
129 bool gpu_service_logging = false; | 129 bool gpu_service_logging = false; |
130 bool disable_gl_drawing = disable_drawing; | 130 // Unit tests do not produce pixel output by default. |
131 // TODO(danakj): Unit tests do not produce pixel output by default. | 131 bool disable_gl_drawing = true; |
132 // bool disable_gl_drawing = true; | |
133 | 132 |
134 CHECK(InitializeOneOffImplementation( | 133 CHECK(InitializeOneOffImplementation( |
135 impl, fallback_to_osmesa, gpu_service_logging, disable_gl_drawing)); | 134 impl, fallback_to_osmesa, gpu_service_logging, disable_gl_drawing)); |
136 } | 135 } |
137 | 136 |
138 // static | 137 // static |
139 void GLSurface::InitializeOneOffWithMockBindingsForTests() { | 138 void GLSurface::InitializeOneOffWithMockBindingsForTests() { |
140 DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) | 139 DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) |
141 << "kUseGL has not effect in tests"; | 140 << "kUseGL has not effect in tests"; |
142 | 141 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 return surface_->GetFormat(); | 339 return surface_->GetFormat(); |
341 } | 340 } |
342 | 341 |
343 VSyncProvider* GLSurfaceAdapter::GetVSyncProvider() { | 342 VSyncProvider* GLSurfaceAdapter::GetVSyncProvider() { |
344 return surface_->GetVSyncProvider(); | 343 return surface_->GetVSyncProvider(); |
345 } | 344 } |
346 | 345 |
347 GLSurfaceAdapter::~GLSurfaceAdapter() {} | 346 GLSurfaceAdapter::~GLSurfaceAdapter() {} |
348 | 347 |
349 } // namespace gfx | 348 } // namespace gfx |
OLD | NEW |