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

Side by Side Diff: ui/gl/gl_surface.cc

Issue 145293007: ui: No more TestCompositor. Use NullDraw contexts in unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: testsnulldraw: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/compositor/test/test_context_factory.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/compositor/test/test_context_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698