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

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

Issue 13555004: Aura: Make compositor_unittests work with --ui-enable-threaded-compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Set the delegates. DCHECK not called if threaded. 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/layer_unittest.cc » ('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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 if (root_layer_) 467 if (root_layer_)
468 root_layer_->SetCompositor(NULL); 468 root_layer_->SetCompositor(NULL);
469 469
470 // Stop all outstanding draws before telling the ContextFactory to tear 470 // Stop all outstanding draws before telling the ContextFactory to tear
471 // down any contexts that the |host_| may rely upon. 471 // down any contexts that the |host_| may rely upon.
472 host_.reset(); 472 host_.reset();
473 473
474 ContextFactory::GetInstance()->RemoveCompositor(this); 474 ContextFactory::GetInstance()->RemoveCompositor(this);
475 } 475 }
476 476
477 // static
477 void Compositor::Initialize(bool use_thread) { 478 void Compositor::Initialize(bool use_thread) {
478 if (use_thread) { 479 if (use_thread) {
479 g_compositor_thread = new base::Thread("Browser Compositor"); 480 g_compositor_thread = new base::Thread("Browser Compositor");
480 g_compositor_thread->Start(); 481 g_compositor_thread->Start();
481 } 482 }
482 } 483 }
483 484
485 // static
486 bool Compositor::WasInitializedWithThread() {
487 return !!g_compositor_thread;
488 }
489
490 // static
484 void Compositor::Terminate() { 491 void Compositor::Terminate() {
485 if (g_compositor_thread) { 492 if (g_compositor_thread) {
486 g_compositor_thread->Stop(); 493 g_compositor_thread->Stop();
487 delete g_compositor_thread; 494 delete g_compositor_thread;
488 g_compositor_thread = NULL; 495 g_compositor_thread = NULL;
489 } 496 }
490 } 497 }
491 498
492 void Compositor::ScheduleDraw() { 499 void Compositor::ScheduleDraw() {
493 if (g_compositor_thread) 500 if (g_compositor_thread)
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 COMPOSITOR_EXPORT void DisableTestCompositor() { 736 COMPOSITOR_EXPORT void DisableTestCompositor() {
730 ResetImplicitFactory(); 737 ResetImplicitFactory();
731 g_test_compositor_enabled = false; 738 g_test_compositor_enabled = false;
732 } 739 }
733 740
734 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { 741 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() {
735 return g_test_compositor_enabled; 742 return g_test_compositor_enabled;
736 } 743 }
737 744
738 } // namespace ui 745 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/compositor.h ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698