| 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/threading/thread_task_runner_handle.h" | 7 #include "base/threading/thread_task_runner_handle.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "ui/aura/client/capture_client.h" | 9 #include "ui/aura/client/capture_client.h" |
| 10 #include "ui/aura/client/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 Env::GetInstance()->context_factory_private(); | 253 Env::GetInstance()->context_factory_private(); |
| 254 compositor_.reset(new ui::Compositor( | 254 compositor_.reset(new ui::Compositor( |
| 255 frame_sink_id.is_valid() ? frame_sink_id | 255 frame_sink_id.is_valid() ? frame_sink_id |
| 256 : context_factory_private->AllocateFrameSinkId(), | 256 : context_factory_private->AllocateFrameSinkId(), |
| 257 context_factory, context_factory_private, | 257 context_factory, context_factory_private, |
| 258 base::ThreadTaskRunnerHandle::Get())); | 258 base::ThreadTaskRunnerHandle::Get())); |
| 259 if (!dispatcher()) { | 259 if (!dispatcher()) { |
| 260 window()->Init(ui::LAYER_NOT_DRAWN); | 260 window()->Init(ui::LAYER_NOT_DRAWN); |
| 261 window()->set_host(this); | 261 window()->set_host(this); |
| 262 window()->SetName("RootWindow"); | 262 window()->SetName("RootWindow"); |
| 263 window()->SetEventTargeter( |
| 264 std::unique_ptr<ui::EventTargeter>(new WindowTargeter())); |
| 263 dispatcher_.reset(new WindowEventDispatcher(this)); | 265 dispatcher_.reset(new WindowEventDispatcher(this)); |
| 264 } | 266 } |
| 265 } | 267 } |
| 266 | 268 |
| 267 void WindowTreeHost::InitCompositor() { | 269 void WindowTreeHost::InitCompositor() { |
| 268 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), | 270 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), |
| 269 GetBoundsInPixels().size()); | 271 GetBoundsInPixels().size()); |
| 270 compositor_->SetRootLayer(window()->layer()); | 272 compositor_->SetRootLayer(window()->layer()); |
| 271 compositor_->SetDisplayColorSpace( | 273 compositor_->SetDisplayColorSpace( |
| 272 GetICCProfileForCurrentDisplay().GetColorSpace()); | 274 GetICCProfileForCurrentDisplay().GetColorSpace()); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 client::CursorClient* cursor_client = client::GetCursorClient(window()); | 347 client::CursorClient* cursor_client = client::GetCursorClient(window()); |
| 346 if (cursor_client) { | 348 if (cursor_client) { |
| 347 const display::Display& display = | 349 const display::Display& display = |
| 348 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); | 350 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); |
| 349 cursor_client->SetDisplay(display); | 351 cursor_client->SetDisplay(display); |
| 350 } | 352 } |
| 351 dispatcher()->OnCursorMovedToRootLocation(root_location); | 353 dispatcher()->OnCursorMovedToRootLocation(root_location); |
| 352 } | 354 } |
| 353 | 355 |
| 354 } // namespace aura | 356 } // namespace aura |
| OLD | NEW |