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(bool context_factory_for_test) | 66 InProcessContextFactory::InProcessContextFactory(bool context_factory_for_test) |
67 : next_surface_id_namespace_(1u), | 67 : next_surface_id_namespace_(1u), |
68 use_test_surface_(true), | 68 use_test_surface_(true), |
69 context_factory_for_test_(context_factory_for_test) { | 69 context_factory_for_test_(context_factory_for_test) { |
70 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone) | 70 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone) |
71 << "If running tests, ensure that main() is calling " | 71 << "If running tests, ensure that main() is calling " |
72 << "gfx::GLSurface::InitializeOneOffForTests()"; | 72 << "gfx::GLSurface::InitializeOneOffForTests()"; |
73 | |
74 #if defined(OS_CHROMEOS) | |
75 bool use_thread = !CommandLine::ForCurrentProcess()->HasSwitch( | |
76 switches::kUIDisableThreadedCompositing); | |
danakj
2014/12/06 17:17:43
Not: remove the switch too if these are the only u
| |
77 #else | |
78 bool use_thread = false; | |
79 #endif | |
80 if (use_thread) { | |
81 compositor_thread_.reset(new base::Thread("Browser Compositor")); | |
82 compositor_thread_->Start(); | |
83 } | |
84 } | 73 } |
85 | 74 |
86 InProcessContextFactory::~InProcessContextFactory() {} | 75 InProcessContextFactory::~InProcessContextFactory() {} |
87 | 76 |
88 void InProcessContextFactory::CreateOutputSurface( | 77 void InProcessContextFactory::CreateOutputSurface( |
89 base::WeakPtr<Compositor> compositor, | 78 base::WeakPtr<Compositor> compositor, |
90 bool software_fallback) { | 79 bool software_fallback) { |
91 DCHECK(!software_fallback); | 80 DCHECK(!software_fallback); |
92 blink::WebGraphicsContext3D::Attributes attrs; | 81 blink::WebGraphicsContext3D::Attributes attrs; |
93 attrs.depth = false; | 82 attrs.depth = false; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 InProcessContextFactory::CreateSurfaceIdAllocator() { | 156 InProcessContextFactory::CreateSurfaceIdAllocator() { |
168 return make_scoped_ptr( | 157 return make_scoped_ptr( |
169 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); | 158 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); |
170 } | 159 } |
171 | 160 |
172 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, | 161 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, |
173 const gfx::Size& size) { | 162 const gfx::Size& size) { |
174 } | 163 } |
175 | 164 |
176 } // namespace ui | 165 } // namespace ui |
OLD | NEW |