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

Side by Side Diff: ui/compositor/test/context_factories_for_test.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/compositor/test/context_factories_for_test.h"
6
7 #include "base/command_line.h"
8 #include "base/sys_info.h"
9 #include "ui/compositor/compositor.h"
10 #include "ui/compositor/compositor_switches.h"
11 #include "ui/compositor/test/in_process_context_factory.h"
12 #include "ui/gl/gl_implementation.h"
13
14 namespace {
15
16 static ui::ContextFactory* g_implicit_factory = NULL;
17 static gfx::DisableNullDrawGLBindings* g_disable_null_draw = NULL;
18
19 } // namespace
20
21 namespace ui {
22
23 // static
24 ui::ContextFactory* InitializeContextFactoryForTests(bool enable_pixel_output) {
25 DCHECK(!g_implicit_factory) <<
26 "ContextFactory for tests already initialized.";
27 CommandLine* command_line = CommandLine::ForCurrentProcess();
28 if (command_line->HasSwitch(switches::kEnablePixelOutputInTests))
29 enable_pixel_output = true;
30 if (enable_pixel_output)
31 g_disable_null_draw = new gfx::DisableNullDrawGLBindings;
32 g_implicit_factory = new InProcessContextFactory();
33 return g_implicit_factory;
34 }
35
36 void TerminateContextFactoryForTests() {
37 delete g_implicit_factory;
38 g_implicit_factory = NULL;
39 delete g_disable_null_draw;
40 g_disable_null_draw = NULL;
41 }
42
43 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/test/context_factories_for_test.h ('k') | ui/compositor/test/draw_waiter_for_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698