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

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

Issue 12088092: CrOS: Enable threaded UI compositor by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Just for CrOS. Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « ui/compositor/compositor.h ('k') | ui/compositor/compositor_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/compositor/compositor.h ('k') | ui/compositor/compositor_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698