OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/aura/window_tree_host.h" | 5 #include "ui/aura/window_tree_host.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/message_loop/message_loop.h" |
8 #include "ui/aura/client/capture_client.h" | 9 #include "ui/aura/client/capture_client.h" |
9 #include "ui/aura/client/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
10 #include "ui/aura/env.h" | 11 #include "ui/aura/env.h" |
11 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
12 #include "ui/aura/window_event_dispatcher.h" | 13 #include "ui/aura/window_event_dispatcher.h" |
13 #include "ui/aura/window_targeter.h" | 14 #include "ui/aura/window_targeter.h" |
14 #include "ui/aura/window_tree_host_observer.h" | 15 #include "ui/aura/window_tree_host_observer.h" |
15 #include "ui/base/view_prop.h" | 16 #include "ui/base/view_prop.h" |
16 #include "ui/compositor/dip_util.h" | 17 #include "ui/compositor/dip_util.h" |
17 #include "ui/compositor/layer.h" | 18 #include "ui/compositor/layer.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // we ensure GetRootWindow() still returns this. | 198 // we ensure GetRootWindow() still returns this. |
198 //window()->RemoveOrDestroyChildren(); | 199 //window()->RemoveOrDestroyChildren(); |
199 } | 200 } |
200 | 201 |
201 void WindowTreeHost::CreateCompositor( | 202 void WindowTreeHost::CreateCompositor( |
202 gfx::AcceleratedWidget accelerated_widget) { | 203 gfx::AcceleratedWidget accelerated_widget) { |
203 DCHECK(Env::GetInstance()); | 204 DCHECK(Env::GetInstance()); |
204 ui::ContextFactory* context_factory = Env::GetInstance()->context_factory(); | 205 ui::ContextFactory* context_factory = Env::GetInstance()->context_factory(); |
205 DCHECK(context_factory); | 206 DCHECK(context_factory); |
206 compositor_.reset( | 207 compositor_.reset( |
207 new ui::Compositor(GetAcceleratedWidget(), context_factory)); | 208 new ui::Compositor(GetAcceleratedWidget(), |
| 209 context_factory, |
| 210 base::MessageLoopProxy::current())); |
208 // TODO(beng): I think this setup should probably all move to a "accelerated | 211 // TODO(beng): I think this setup should probably all move to a "accelerated |
209 // widget available" function. | 212 // widget available" function. |
210 if (!dispatcher()) { | 213 if (!dispatcher()) { |
211 window()->Init(WINDOW_LAYER_NOT_DRAWN); | 214 window()->Init(WINDOW_LAYER_NOT_DRAWN); |
212 window()->set_host(this); | 215 window()->set_host(this); |
213 window()->SetName("RootWindow"); | 216 window()->SetName("RootWindow"); |
214 window()->SetEventTargeter( | 217 window()->SetEventTargeter( |
215 scoped_ptr<ui::EventTargeter>(new WindowTargeter())); | 218 scoped_ptr<ui::EventTargeter>(new WindowTargeter())); |
216 prop_.reset(new ui::ViewProp(GetAcceleratedWidget(), | 219 prop_.reset(new ui::ViewProp(GetAcceleratedWidget(), |
217 kWindowTreeHostForAcceleratedWidget, | 220 kWindowTreeHostForAcceleratedWidget, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 client::CursorClient* cursor_client = client::GetCursorClient(window()); | 269 client::CursorClient* cursor_client = client::GetCursorClient(window()); |
267 if (cursor_client) { | 270 if (cursor_client) { |
268 const gfx::Display& display = | 271 const gfx::Display& display = |
269 gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window()); | 272 gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window()); |
270 cursor_client->SetDisplay(display); | 273 cursor_client->SetDisplay(display); |
271 } | 274 } |
272 dispatcher()->OnCursorMovedToRootLocation(root_location); | 275 dispatcher()->OnCursorMovedToRootLocation(root_location); |
273 } | 276 } |
274 | 277 |
275 } // namespace aura | 278 } // namespace aura |
OLD | NEW |