OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/compositor.h" | 5 #include "ui/compositor/compositor.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 271 |
272 ContextFactory::GetInstance()->RemoveCompositor(this); | 272 ContextFactory::GetInstance()->RemoveCompositor(this); |
273 } | 273 } |
274 | 274 |
275 // static | 275 // static |
276 void Compositor::Initialize() { | 276 void Compositor::Initialize() { |
277 #if defined(OS_CHROMEOS) | 277 #if defined(OS_CHROMEOS) |
278 bool use_thread = !CommandLine::ForCurrentProcess()->HasSwitch( | 278 bool use_thread = !CommandLine::ForCurrentProcess()->HasSwitch( |
279 switches::kUIDisableThreadedCompositing); | 279 switches::kUIDisableThreadedCompositing); |
280 #else | 280 #else |
281 bool use_thread = | 281 bool use_thread = false; |
282 CommandLine::ForCurrentProcess()->HasSwitch( | |
283 switches::kUIEnableThreadedCompositing) && | |
284 !CommandLine::ForCurrentProcess()->HasSwitch( | |
285 switches::kUIDisableThreadedCompositing); | |
286 #endif | 282 #endif |
287 if (use_thread) { | 283 if (use_thread) { |
288 g_compositor_thread = new base::Thread("Browser Compositor"); | 284 g_compositor_thread = new base::Thread("Browser Compositor"); |
289 g_compositor_thread->Start(); | 285 g_compositor_thread->Start(); |
290 } | 286 } |
291 | 287 |
292 DCHECK(!g_compositor_initialized) << "Compositor initialized twice."; | 288 DCHECK(!g_compositor_initialized) << "Compositor initialized twice."; |
293 g_compositor_initialized = true; | 289 g_compositor_initialized = true; |
294 } | 290 } |
295 | 291 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 // CompositorObservers to be notified before starting another | 555 // CompositorObservers to be notified before starting another |
560 // draw cycle. | 556 // draw cycle. |
561 ScheduleDraw(); | 557 ScheduleDraw(); |
562 } | 558 } |
563 FOR_EACH_OBSERVER(CompositorObserver, | 559 FOR_EACH_OBSERVER(CompositorObserver, |
564 observer_list_, | 560 observer_list_, |
565 OnCompositingEnded(this)); | 561 OnCompositingEnded(this)); |
566 } | 562 } |
567 | 563 |
568 } // namespace ui | 564 } // namespace ui |
OLD | NEW |