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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
528 root_layer_->SetCompositor(NULL); | 528 root_layer_->SetCompositor(NULL); |
529 | 529 |
530 // Stop all outstanding draws before telling the ContextFactory to tear | 530 // Stop all outstanding draws before telling the ContextFactory to tear |
531 // down any contexts that the |host_| may rely upon. | 531 // down any contexts that the |host_| may rely upon. |
532 host_.reset(); | 532 host_.reset(); |
533 | 533 |
534 ContextFactory::GetInstance()->RemoveCompositor(this); | 534 ContextFactory::GetInstance()->RemoveCompositor(this); |
535 } | 535 } |
536 | 536 |
537 // static | 537 // static |
538 void Compositor::Initialize(bool use_thread) { | 538 void Compositor::Initialize() { |
539 bool use_thread = false; | |
540 #if defined(OS_CHROMEOS) | |
piman
2013/04/09 17:46:24
nit: can we keep the enable flag on other platform
jonathan.backer
2013/04/09 19:37:15
Done.
| |
541 use_thread = !CommandLine::ForCurrentProcess()->HasSwitch( | |
542 switches::kUIDisableThreadedCompositing); | |
543 #endif | |
539 if (use_thread) { | 544 if (use_thread) { |
540 g_compositor_thread = new base::Thread("Browser Compositor"); | 545 g_compositor_thread = new base::Thread("Browser Compositor"); |
541 g_compositor_thread->Start(); | 546 g_compositor_thread->Start(); |
542 } | 547 } |
543 } | 548 } |
544 | 549 |
545 // static | 550 // static |
546 bool Compositor::WasInitializedWithThread() { | 551 bool Compositor::WasInitializedWithThread() { |
547 return !!g_compositor_thread; | 552 return !!g_compositor_thread; |
548 } | 553 } |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
810 COMPOSITOR_EXPORT void DisableTestCompositor() { | 815 COMPOSITOR_EXPORT void DisableTestCompositor() { |
811 ResetImplicitFactory(); | 816 ResetImplicitFactory(); |
812 g_test_compositor_enabled = false; | 817 g_test_compositor_enabled = false; |
813 } | 818 } |
814 | 819 |
815 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { | 820 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { |
816 return g_test_compositor_enabled; | 821 return g_test_compositor_enabled; |
817 } | 822 } |
818 | 823 |
819 } // namespace ui | 824 } // namespace ui |
OLD | NEW |