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

Side by Side Diff: ui/compositor/test/test_compositor_host_linux.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/layer_unittest.cc ('k') | ui/compositor/test/test_compositor_host_mac.mm » ('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/test/test_compositor_host.h" 5 #include "ui/compositor/test/test_compositor_host.h"
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 compositor_.reset(new ui::Compositor(this, window_)); 79 compositor_.reset(new ui::Compositor(this, window_));
80 compositor_->SetScaleAndSize(1.0f, bounds_.size()); 80 compositor_->SetScaleAndSize(1.0f, bounds_.size());
81 } 81 }
82 82
83 ui::Compositor* TestCompositorHostLinux::GetCompositor() { 83 ui::Compositor* TestCompositorHostLinux::GetCompositor() {
84 return compositor_.get(); 84 return compositor_.get();
85 } 85 }
86 86
87 void TestCompositorHostLinux::ScheduleDraw() { 87 void TestCompositorHostLinux::ScheduleDraw() {
88 DCHECK(!ui::Compositor::WasInitializedWithThread());
88 if (!method_factory_.HasWeakPtrs()) { 89 if (!method_factory_.HasWeakPtrs()) {
89 MessageLoopForUI::current()->PostTask( 90 MessageLoopForUI::current()->PostTask(
90 FROM_HERE, 91 FROM_HERE,
91 base::Bind(&TestCompositorHostLinux::Draw, 92 base::Bind(&TestCompositorHostLinux::Draw,
92 method_factory_.GetWeakPtr())); 93 method_factory_.GetWeakPtr()));
93 } 94 }
94 } 95 }
95 96
96 void TestCompositorHostLinux::Draw() { 97 void TestCompositorHostLinux::Draw() {
97 if (compositor_.get()) 98 if (compositor_.get())
98 compositor_->Draw(false); 99 compositor_->Draw(false);
99 } 100 }
100 101
101 // static 102 // static
102 TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) { 103 TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) {
103 return new TestCompositorHostLinux(bounds); 104 return new TestCompositorHostLinux(bounds);
104 } 105 }
105 106
106 } // namespace ui 107 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer_unittest.cc ('k') | ui/compositor/test/test_compositor_host_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698