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 <utility> | 5 #include <utility> |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 std::unique_ptr<ui::Renderer> RendererFactory::CreateRenderer( | 212 std::unique_ptr<ui::Renderer> RendererFactory::CreateRenderer( |
213 gfx::AcceleratedWidget widget, | 213 gfx::AcceleratedWidget widget, |
214 const gfx::Size& size) { | 214 const gfx::Size& size) { |
215 switch (type_) { | 215 switch (type_) { |
216 case GL: { | 216 case GL: { |
217 scoped_refptr<gl::GLSurface> surface = CreateGLSurface(widget); | 217 scoped_refptr<gl::GLSurface> surface = CreateGLSurface(widget); |
218 if (!surface) | 218 if (!surface) |
219 LOG(FATAL) << "Failed to create GL surface"; | 219 LOG(FATAL) << "Failed to create GL surface"; |
220 if (surface->IsSurfaceless()) | 220 if (surface->IsSurfaceless()) |
221 return base::WrapUnique( | 221 return base::MakeUnique<ui::SurfacelessGlRenderer>(widget, surface, |
222 new ui::SurfacelessGlRenderer(widget, surface, size)); | 222 size); |
223 else | 223 else |
224 return base::WrapUnique(new ui::GlRenderer(widget, surface, size)); | 224 return base::MakeUnique<ui::GlRenderer>(widget, surface, size); |
225 } | 225 } |
226 case SOFTWARE: | 226 case SOFTWARE: |
227 return base::WrapUnique(new ui::SoftwareRenderer(widget, size)); | 227 return base::MakeUnique<ui::SoftwareRenderer>(widget, size); |
228 } | 228 } |
229 | 229 |
230 return nullptr; | 230 return nullptr; |
231 } | 231 } |
232 | 232 |
233 /////////////////////////////////////////////////////////////////////////////// | 233 /////////////////////////////////////////////////////////////////////////////// |
234 // WindowManager implementation: | 234 // WindowManager implementation: |
235 | 235 |
236 WindowManager::WindowManager(const base::Closure& quit_closure) | 236 WindowManager::WindowManager(const base::Closure& quit_closure) |
237 : delegate_( | 237 : delegate_( |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 ->SetCurrentLayoutByName("us"); | 337 ->SetCurrentLayoutByName("us"); |
338 | 338 |
339 base::RunLoop run_loop; | 339 base::RunLoop run_loop; |
340 | 340 |
341 WindowManager window_manager(run_loop.QuitClosure()); | 341 WindowManager window_manager(run_loop.QuitClosure()); |
342 | 342 |
343 run_loop.Run(); | 343 run_loop.Run(); |
344 | 344 |
345 return 0; | 345 return 0; |
346 } | 346 } |
OLD | NEW |