| 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 "ui/compositor/test/in_process_context_factory.h" | 5 #include "ui/compositor/test/in_process_context_factory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 } // namespace | 64 } // namespace |
| 65 | 65 |
| 66 InProcessContextFactory::InProcessContextFactory() | 66 InProcessContextFactory::InProcessContextFactory() |
| 67 : next_surface_id_namespace_(1u), use_test_surface_(true) { | 67 : next_surface_id_namespace_(1u), use_test_surface_(true) { |
| 68 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone) | 68 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone) |
| 69 << "If running tests, ensure that main() is calling " | 69 << "If running tests, ensure that main() is calling " |
| 70 << "gfx::GLSurface::InitializeOneOffForTests()"; | 70 << "gfx::GLSurface::InitializeOneOffForTests()"; |
| 71 | 71 |
| 72 #if defined(OS_CHROMEOS) | 72 #if defined(OS_CHROMEOS) |
| 73 bool use_thread = !CommandLine::ForCurrentProcess()->HasSwitch( | 73 bool use_thread = !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 74 switches::kUIDisableThreadedCompositing); | 74 switches::kUIDisableThreadedCompositing); |
| 75 #else | 75 #else |
| 76 bool use_thread = false; | 76 bool use_thread = false; |
| 77 #endif | 77 #endif |
| 78 if (use_thread) { | 78 if (use_thread) { |
| 79 compositor_thread_.reset(new base::Thread("Browser Compositor")); | 79 compositor_thread_.reset(new base::Thread("Browser Compositor")); |
| 80 compositor_thread_->Start(); | 80 compositor_thread_->Start(); |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 | 83 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 InProcessContextFactory::CreateSurfaceIdAllocator() { | 163 InProcessContextFactory::CreateSurfaceIdAllocator() { |
| 164 return make_scoped_ptr( | 164 return make_scoped_ptr( |
| 165 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); | 165 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, | 168 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, |
| 169 const gfx::Size& size) { | 169 const gfx::Size& size) { |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace ui | 172 } // namespace ui |
| OLD | NEW |