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

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

Issue 781163003: Flip flag to turn CrOS Browser Compositor Single Threaded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 10 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
« no previous file with comments | « content/browser/compositor/gpu_process_transport_factory.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 InProcessContextFactory::InProcessContextFactory( 67 InProcessContextFactory::InProcessContextFactory(
68 bool context_factory_for_test, 68 bool context_factory_for_test,
69 cc::SurfaceManager* surface_manager) 69 cc::SurfaceManager* surface_manager)
70 : next_surface_id_namespace_(1u), 70 : next_surface_id_namespace_(1u),
71 use_test_surface_(true), 71 use_test_surface_(true),
72 context_factory_for_test_(context_factory_for_test), 72 context_factory_for_test_(context_factory_for_test),
73 surface_manager_(surface_manager) { 73 surface_manager_(surface_manager) {
74 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone) 74 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone)
75 << "If running tests, ensure that main() is calling " 75 << "If running tests, ensure that main() is calling "
76 << "gfx::GLSurface::InitializeOneOffForTests()"; 76 << "gfx::GLSurface::InitializeOneOffForTests()";
77
78 #if defined(OS_CHROMEOS)
79 bool use_thread = !base::CommandLine::ForCurrentProcess()->HasSwitch(
80 switches::kUIDisableThreadedCompositing);
81 #else
82 bool use_thread = false;
83 #endif
84 if (use_thread) {
85 compositor_thread_.reset(new base::Thread("Browser Compositor"));
86 compositor_thread_->Start();
87 }
88 } 77 }
89 78
90 InProcessContextFactory::~InProcessContextFactory() { 79 InProcessContextFactory::~InProcessContextFactory() {
91 DCHECK(per_compositor_data_.empty()); 80 DCHECK(per_compositor_data_.empty());
92 } 81 }
93 82
94 void InProcessContextFactory::CreateOutputSurface( 83 void InProcessContextFactory::CreateOutputSurface(
95 base::WeakPtr<Compositor> compositor, 84 base::WeakPtr<Compositor> compositor,
96 bool software_fallback) { 85 bool software_fallback) {
97 DCHECK(!software_fallback); 86 DCHECK(!software_fallback);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 192 }
204 193
205 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, 194 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor,
206 const gfx::Size& size) { 195 const gfx::Size& size) {
207 if (!per_compositor_data_.count(compositor)) 196 if (!per_compositor_data_.count(compositor))
208 return; 197 return;
209 per_compositor_data_[compositor]->display()->Resize(size); 198 per_compositor_data_[compositor]->display()->Resize(size);
210 } 199 }
211 200
212 } // namespace ui 201 } // namespace ui
OLDNEW
« no previous file with comments | « content/browser/compositor/gpu_process_transport_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698