| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 192 |
| 193 RendererFactory::RendererFactory() : type_(SOFTWARE) { | 193 RendererFactory::RendererFactory() : type_(SOFTWARE) { |
| 194 } | 194 } |
| 195 | 195 |
| 196 RendererFactory::~RendererFactory() { | 196 RendererFactory::~RendererFactory() { |
| 197 } | 197 } |
| 198 | 198 |
| 199 bool RendererFactory::Initialize() { | 199 bool RendererFactory::Initialize() { |
| 200 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 200 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 201 if (!command_line->HasSwitch(kDisableGpu) && | 201 if (!command_line->HasSwitch(kDisableGpu) && |
| 202 gfx::GLSurface::InitializeOneOff() && | 202 gfx::GLSurface::InitializeOneOff()) { |
| 203 gpu_helper_.Initialize(base::ThreadTaskRunnerHandle::Get(), | 203 ui::OzonePlatform::InitializeForGPUPostMainLoop(); |
| 204 base::ThreadTaskRunnerHandle::Get())) { | 204 if (gpu_helper_.Initialize(base::ThreadTaskRunnerHandle::Get(), |
| 205 if (command_line->HasSwitch(switches::kOzoneUseSurfaceless)) { | 205 base::ThreadTaskRunnerHandle::Get())) { |
| 206 type_ = SURFACELESS_GL; | 206 if (command_line->HasSwitch(switches::kOzoneUseSurfaceless)) { |
| 207 } else { | 207 type_ = SURFACELESS_GL; |
| 208 type_ = GL; | 208 } else { |
| 209 type_ = GL; |
| 210 } |
| 209 } | 211 } |
| 210 } else { | 212 } else { |
| 211 type_ = SOFTWARE; | 213 type_ = SOFTWARE; |
| 212 } | 214 } |
| 213 | 215 |
| 214 return true; | 216 return true; |
| 215 } | 217 } |
| 216 | 218 |
| 217 scoped_ptr<ui::Renderer> RendererFactory::CreateRenderer( | 219 scoped_ptr<ui::Renderer> RendererFactory::CreateRenderer( |
| 218 gfx::AcceleratedWidget widget, | 220 gfx::AcceleratedWidget widget, |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 ->SetCurrentLayoutByName("us"); | 341 ->SetCurrentLayoutByName("us"); |
| 340 | 342 |
| 341 base::RunLoop run_loop; | 343 base::RunLoop run_loop; |
| 342 | 344 |
| 343 WindowManager window_manager(run_loop.QuitClosure()); | 345 WindowManager window_manager(run_loop.QuitClosure()); |
| 344 | 346 |
| 345 run_loop.Run(); | 347 run_loop.Run(); |
| 346 | 348 |
| 347 return 0; | 349 return 0; |
| 348 } | 350 } |
| OLD | NEW |