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

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

Issue 306123007: Removes usage of Compositor/ContextFactory methods (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/aura/demo/demo_main.cc ('k') | ui/views/examples/examples_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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/compositor/test/context_factories_for_test.h" 5 #include "ui/compositor/test/context_factories_for_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/sys_info.h" 8 #include "base/sys_info.h"
9 #include "ui/compositor/compositor.h" 9 #include "ui/compositor/compositor.h"
10 #include "ui/compositor/compositor_switches.h" 10 #include "ui/compositor/compositor_switches.h"
(...skipping 12 matching lines...) Expand all
23 // static 23 // static
24 ui::ContextFactory* InitializeContextFactoryForTests(bool enable_pixel_output) { 24 ui::ContextFactory* InitializeContextFactoryForTests(bool enable_pixel_output) {
25 DCHECK(!g_implicit_factory) << 25 DCHECK(!g_implicit_factory) <<
26 "ContextFactory for tests already initialized."; 26 "ContextFactory for tests already initialized.";
27 CommandLine* command_line = CommandLine::ForCurrentProcess(); 27 CommandLine* command_line = CommandLine::ForCurrentProcess();
28 if (command_line->HasSwitch(switches::kEnablePixelOutputInTests)) 28 if (command_line->HasSwitch(switches::kEnablePixelOutputInTests))
29 enable_pixel_output = true; 29 enable_pixel_output = true;
30 if (enable_pixel_output) 30 if (enable_pixel_output)
31 g_disable_null_draw = new gfx::DisableNullDrawGLBindings; 31 g_disable_null_draw = new gfx::DisableNullDrawGLBindings;
32 g_implicit_factory = new InProcessContextFactory(); 32 g_implicit_factory = new InProcessContextFactory();
33 ContextFactory::SetInstance(g_implicit_factory);
34 return g_implicit_factory; 33 return g_implicit_factory;
35 } 34 }
36 35
37 void TerminateContextFactoryForTests() { 36 void TerminateContextFactoryForTests() {
38 ContextFactory::SetInstance(NULL);
39 delete g_implicit_factory; 37 delete g_implicit_factory;
40 g_implicit_factory = NULL; 38 g_implicit_factory = NULL;
41 delete g_disable_null_draw; 39 delete g_disable_null_draw;
42 g_disable_null_draw = NULL; 40 g_disable_null_draw = NULL;
43 } 41 }
44 42
45 } // namespace ui 43 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/demo/demo_main.cc ('k') | ui/views/examples/examples_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698