| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "components/viz/common/switches.h" | 10 #include "components/viz/common/switches.h" |
| 11 #include "ui/aura/client/capture_client.h" | 11 #include "ui/aura/client/capture_client.h" |
| 12 #include "ui/aura/client/cursor_client.h" | 12 #include "ui/aura/client/cursor_client.h" |
| 13 #include "ui/aura/env.h" | 13 #include "ui/aura/env.h" |
| 14 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
| 15 #include "ui/aura/window_event_dispatcher.h" | 15 #include "ui/aura/window_event_dispatcher.h" |
| 16 #include "ui/aura/window_port.h" | 16 #include "ui/aura/window_port.h" |
| 17 #include "ui/aura/window_targeter.h" | 17 #include "ui/aura/window_targeter.h" |
| 18 #include "ui/aura/window_tree_host_observer.h" | 18 #include "ui/aura/window_tree_host_observer.h" |
| 19 #include "ui/base/ime/input_method.h" | 19 #include "ui/base/ime/input_method.h" |
| 20 #include "ui/base/ime/input_method_factory.h" | 20 #include "ui/base/ime/input_method_factory.h" |
| 21 #include "ui/base/layout.h" | 21 #include "ui/base/layout.h" |
| 22 #include "ui/base/view_prop.h" | 22 #include "ui/base/view_prop.h" |
| 23 #include "ui/compositor/compositor_switches.h" |
| 23 #include "ui/compositor/dip_util.h" | 24 #include "ui/compositor/dip_util.h" |
| 24 #include "ui/compositor/layer.h" | 25 #include "ui/compositor/layer.h" |
| 25 #include "ui/display/display.h" | 26 #include "ui/display/display.h" |
| 26 #include "ui/display/screen.h" | 27 #include "ui/display/screen.h" |
| 27 #include "ui/gfx/geometry/insets.h" | 28 #include "ui/gfx/geometry/insets.h" |
| 28 #include "ui/gfx/geometry/point.h" | 29 #include "ui/gfx/geometry/point.h" |
| 29 #include "ui/gfx/geometry/point3_f.h" | 30 #include "ui/gfx/geometry/point3_f.h" |
| 30 #include "ui/gfx/geometry/point_conversions.h" | 31 #include "ui/gfx/geometry/point_conversions.h" |
| 31 #include "ui/gfx/geometry/rect_conversions.h" | 32 #include "ui/gfx/geometry/rect_conversions.h" |
| 32 #include "ui/gfx/geometry/size_conversions.h" | 33 #include "ui/gfx/geometry/size_conversions.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 Env::GetInstance()->context_factory_private(); | 264 Env::GetInstance()->context_factory_private(); |
| 264 bool enable_surface_synchronization = | 265 bool enable_surface_synchronization = |
| 265 aura::Env::GetInstance()->mode() == aura::Env::Mode::MUS || | 266 aura::Env::GetInstance()->mode() == aura::Env::Mode::MUS || |
| 266 base::CommandLine::ForCurrentProcess()->HasSwitch( | 267 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 267 switches::kEnableSurfaceSynchronization); | 268 switches::kEnableSurfaceSynchronization); |
| 268 compositor_.reset(new ui::Compositor( | 269 compositor_.reset(new ui::Compositor( |
| 269 (!context_factory_private || frame_sink_id.is_valid()) | 270 (!context_factory_private || frame_sink_id.is_valid()) |
| 270 ? frame_sink_id | 271 ? frame_sink_id |
| 271 : context_factory_private->AllocateFrameSinkId(), | 272 : context_factory_private->AllocateFrameSinkId(), |
| 272 context_factory, context_factory_private, | 273 context_factory, context_factory_private, |
| 273 base::ThreadTaskRunnerHandle::Get(), enable_surface_synchronization)); | 274 base::ThreadTaskRunnerHandle::Get(), enable_surface_synchronization, |
| 275 ui::IsPixelCanvasRecordingEnabled())); |
| 274 if (!dispatcher()) { | 276 if (!dispatcher()) { |
| 275 window()->Init(ui::LAYER_NOT_DRAWN); | 277 window()->Init(ui::LAYER_NOT_DRAWN); |
| 276 window()->set_host(this); | 278 window()->set_host(this); |
| 277 window()->SetName("RootWindow"); | 279 window()->SetName("RootWindow"); |
| 278 dispatcher_.reset(new WindowEventDispatcher(this)); | 280 dispatcher_.reset(new WindowEventDispatcher(this)); |
| 279 } | 281 } |
| 280 } | 282 } |
| 281 | 283 |
| 282 void WindowTreeHost::InitCompositor() { | 284 void WindowTreeHost::InitCompositor() { |
| 283 display::Display display = | 285 display::Display display = |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 client::CursorClient* cursor_client = client::GetCursorClient(window()); | 372 client::CursorClient* cursor_client = client::GetCursorClient(window()); |
| 371 if (cursor_client) { | 373 if (cursor_client) { |
| 372 const display::Display& display = | 374 const display::Display& display = |
| 373 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); | 375 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); |
| 374 cursor_client->SetDisplay(display); | 376 cursor_client->SetDisplay(display); |
| 375 } | 377 } |
| 376 dispatcher()->OnCursorMovedToRootLocation(root_location); | 378 dispatcher()->OnCursorMovedToRootLocation(root_location); |
| 377 } | 379 } |
| 378 | 380 |
| 379 } // namespace aura | 381 } // namespace aura |
| OLD | NEW |