OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/ui/ws/platform_display.h" | 5 #include "services/ui/ws/platform_display.h" |
6 | 6 |
7 #include "base/numerics/safe_conversions.h" | 7 #include "base/numerics/safe_conversions.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "cc/ipc/quads.mojom.h" | 9 #include "cc/ipc/quads.mojom.h" |
10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
11 #include "cc/output/delegated_frame_data.h" | 11 #include "cc/output/delegated_frame_data.h" |
12 #include "gpu/ipc/client/gpu_channel_host.h" | 12 #include "gpu/ipc/client/gpu_channel_host.h" |
13 #include "services/shell/public/cpp/connection.h" | 13 #include "services/shell/public/cpp/connection.h" |
14 #include "services/shell/public/cpp/connector.h" | 14 #include "services/shell/public/cpp/connector.h" |
15 #include "services/ui/display/platform_screen.h" | 15 #include "services/ui/display/platform_screen.h" |
| 16 #include "services/ui/surfaces/compositor_frame_sink.h" |
16 #include "services/ui/surfaces/display_compositor.h" | 17 #include "services/ui/surfaces/display_compositor.h" |
17 #include "services/ui/surfaces/surfaces_state.h" | |
18 #include "services/ui/ws/platform_display_factory.h" | 18 #include "services/ui/ws/platform_display_factory.h" |
19 #include "services/ui/ws/platform_display_init_params.h" | 19 #include "services/ui/ws/platform_display_init_params.h" |
20 #include "services/ui/ws/server_window.h" | 20 #include "services/ui/ws/server_window.h" |
21 #include "services/ui/ws/window_coordinate_conversions.h" | 21 #include "services/ui/ws/window_coordinate_conversions.h" |
22 #include "third_party/skia/include/core/SkXfermode.h" | 22 #include "third_party/skia/include/core/SkXfermode.h" |
23 #include "ui/base/cursor/cursor_loader.h" | 23 #include "ui/base/cursor/cursor_loader.h" |
24 #include "ui/display/display.h" | 24 #include "ui/display/display.h" |
25 #include "ui/events/event.h" | 25 #include "ui/events/event.h" |
26 #include "ui/events/event_utils.h" | 26 #include "ui/events/event_utils.h" |
27 #include "ui/platform_window/platform_ime_controller.h" | 27 #include "ui/platform_window/platform_ime_controller.h" |
(...skipping 24 matching lines...) Expand all Loading... |
52 | 52 |
53 return new DefaultPlatformDisplay(init_params); | 53 return new DefaultPlatformDisplay(init_params); |
54 } | 54 } |
55 | 55 |
56 DefaultPlatformDisplay::DefaultPlatformDisplay( | 56 DefaultPlatformDisplay::DefaultPlatformDisplay( |
57 const PlatformDisplayInitParams& init_params) | 57 const PlatformDisplayInitParams& init_params) |
58 : id_(init_params.display_id), | 58 : id_(init_params.display_id), |
59 #if !defined(OS_ANDROID) | 59 #if !defined(OS_ANDROID) |
60 cursor_loader_(ui::CursorLoader::Create()), | 60 cursor_loader_(ui::CursorLoader::Create()), |
61 #endif | 61 #endif |
62 frame_generator_(new FrameGenerator(this, init_params.surfaces_state)) { | 62 frame_generator_( |
| 63 new FrameGenerator(this, init_params.display_compositor)) { |
63 metrics_.bounds = init_params.display_bounds; | 64 metrics_.bounds = init_params.display_bounds; |
64 } | 65 } |
65 | 66 |
66 void DefaultPlatformDisplay::Init(PlatformDisplayDelegate* delegate) { | 67 void DefaultPlatformDisplay::Init(PlatformDisplayDelegate* delegate) { |
67 delegate_ = delegate; | 68 delegate_ = delegate; |
68 | 69 |
69 #if defined(OS_WIN) | 70 #if defined(OS_WIN) |
70 platform_window_.reset(new ui::WinWindow(this, metrics_.bounds)); | 71 platform_window_.reset(new ui::WinWindow(this, metrics_.bounds)); |
71 #elif defined(USE_X11) | 72 #elif defined(USE_X11) |
72 platform_window_.reset(new ui::X11Window(this)); | 73 platform_window_.reset(new ui::X11Window(this)); |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 NOTREACHED(); | 279 NOTREACHED(); |
279 } | 280 } |
280 | 281 |
281 void DefaultPlatformDisplay::OnActivationChanged(bool active) {} | 282 void DefaultPlatformDisplay::OnActivationChanged(bool active) {} |
282 | 283 |
283 void DefaultPlatformDisplay::RequestCopyOfOutput( | 284 void DefaultPlatformDisplay::RequestCopyOfOutput( |
284 std::unique_ptr<cc::CopyOutputRequest> output_request) { | 285 std::unique_ptr<cc::CopyOutputRequest> output_request) { |
285 frame_generator_->RequestCopyOfOutput(std::move(output_request)); | 286 frame_generator_->RequestCopyOfOutput(std::move(output_request)); |
286 } | 287 } |
287 | 288 |
| 289 ServerWindow* DefaultPlatformDisplay::GetActiveRootWindow() { |
| 290 return delegate_->GetActiveRootWindow(); |
| 291 } |
| 292 |
288 ServerWindow* DefaultPlatformDisplay::GetRootWindow() { | 293 ServerWindow* DefaultPlatformDisplay::GetRootWindow() { |
289 return delegate_->GetRootWindow(); | 294 return delegate_->GetRootWindow(); |
290 } | 295 } |
291 | 296 |
292 void DefaultPlatformDisplay::OnCompositorFrameDrawn() { | 297 void DefaultPlatformDisplay::OnCompositorFrameDrawn() { |
293 if (delegate_) | 298 if (delegate_) |
294 delegate_->OnCompositorFrameDrawn(); | 299 delegate_->OnCompositorFrameDrawn(); |
295 } | 300 } |
296 | 301 |
297 bool DefaultPlatformDisplay::IsInHighContrastMode() { | 302 bool DefaultPlatformDisplay::IsInHighContrastMode() { |
298 return delegate_ ? delegate_->IsInHighContrastMode() : false; | 303 return delegate_ ? delegate_->IsInHighContrastMode() : false; |
299 } | 304 } |
300 | 305 |
301 const ViewportMetrics& DefaultPlatformDisplay::GetViewportMetrics() { | 306 const ViewportMetrics& DefaultPlatformDisplay::GetViewportMetrics() { |
302 return metrics_; | 307 return metrics_; |
303 } | 308 } |
304 | 309 |
305 } // namespace ws | 310 } // namespace ws |
306 | 311 |
307 } // namespace ui | 312 } // namespace ui |
OLD | NEW |