Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_default.h" | 5 #include "services/ui/ws/platform_display_default.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "gpu/ipc/client/gpu_channel_host.h" | 8 #include "gpu/ipc/client/gpu_channel_host.h" |
| 9 #include "services/ui/display/screen_manager.h" | 9 #include "services/ui/display/screen_manager.h" |
| 10 #include "services/ui/ws/display_client_compositor_frame_sink.h" | |
| 10 #include "services/ui/ws/platform_display_init_params.h" | 11 #include "services/ui/ws/platform_display_init_params.h" |
| 11 #include "services/ui/ws/server_window.h" | 12 #include "services/ui/ws/server_window.h" |
| 12 #include "ui/base/cursor/image_cursors.h" | 13 #include "ui/base/cursor/image_cursors.h" |
| 13 #include "ui/display/display.h" | 14 #include "ui/display/display.h" |
| 14 #include "ui/events/event.h" | 15 #include "ui/events/event.h" |
| 15 #include "ui/events/event_utils.h" | 16 #include "ui/events/event_utils.h" |
| 16 #include "ui/platform_window/platform_ime_controller.h" | 17 #include "ui/platform_window/platform_ime_controller.h" |
| 17 #include "ui/platform_window/platform_window.h" | 18 #include "ui/platform_window/platform_window.h" |
| 18 | 19 |
| 19 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 | 242 |
| 242 void PlatformDisplayDefault::OnAcceleratedWidgetAvailable( | 243 void PlatformDisplayDefault::OnAcceleratedWidgetAvailable( |
| 243 gfx::AcceleratedWidget widget, | 244 gfx::AcceleratedWidget widget, |
| 244 float device_scale_factor) { | 245 float device_scale_factor) { |
| 245 // This will get called after Init() is called, either synchronously as part | 246 // This will get called after Init() is called, either synchronously as part |
| 246 // of the Init() callstack or async after Init() has returned, depending on | 247 // of the Init() callstack or async after Init() has returned, depending on |
| 247 // the platform. | 248 // the platform. |
| 248 DCHECK_EQ(gfx::kNullAcceleratedWidget, widget_); | 249 DCHECK_EQ(gfx::kNullAcceleratedWidget, widget_); |
| 249 widget_ = widget; | 250 widget_ = widget; |
| 250 delegate_->OnAcceleratedWidgetAvailable(); | 251 delegate_->OnAcceleratedWidgetAvailable(); |
| 251 frame_generator_ = | 252 |
| 252 base::MakeUnique<FrameGenerator>(this, root_window_, widget_); | 253 cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink; |
| 254 cc::mojom::DisplayPrivateAssociatedPtr display_private; | |
| 255 cc::mojom::MojoCompositorFrameSinkClientPtr compositor_frame_sink_client; | |
| 256 cc::mojom::MojoCompositorFrameSinkClientRequest | |
| 257 compositor_frame_sink_client_request = | |
| 258 mojo::MakeRequest(&compositor_frame_sink_client); | |
| 259 cc::mojom::MojoCompositorFrameSinkAssociatedRequest sink_request = | |
| 260 mojo::MakeRequest(&compositor_frame_sink); | |
| 261 cc::mojom::DisplayPrivateAssociatedRequest display_request = | |
| 262 mojo::MakeRequest(&display_private); | |
|
Fady Samuel
2017/03/10 18:37:57
Let's cut down the number of local variables here
| |
| 263 root_window_->CreateRootCompositorFrameSink( | |
| 264 widget_, std::move(sink_request), std::move(compositor_frame_sink_client), | |
|
Fady Samuel
2017/03/10 18:37:57
mojo::MakeRequest(&compositor_frame_sink)
Alex Z.
2017/03/10 19:08:39
Done.
| |
| 265 std::move(display_request)); | |
|
Fady Samuel
2017/03/10 18:37:57
MakeRequest(&display_private)
Alex Z.
2017/03/10 19:08:39
Done.
| |
| 266 | |
| 267 auto display_client_compositor_frame_sink = | |
| 268 base::MakeUnique<DisplayClientCompositorFrameSink>( | |
| 269 root_window_->frame_sink_id(), std::move(compositor_frame_sink), | |
| 270 std::move(display_private), | |
| 271 std::move(compositor_frame_sink_client_request)); | |
|
Fady Samuel
2017/03/10 18:37:57
mojo::MakeRequest(&compositor_frame_sink_client)?
Alex Z.
2017/03/10 19:08:39
Chrome mash window shows no content on startup onc
| |
| 272 frame_generator_ = base::MakeUnique<FrameGenerator>( | |
| 273 this, root_window_, widget_, | |
| 274 std::move(display_client_compositor_frame_sink)); | |
| 253 frame_generator_->SetDeviceScaleFactor(init_device_scale_factor_); | 275 frame_generator_->SetDeviceScaleFactor(init_device_scale_factor_); |
| 254 } | 276 } |
| 255 | 277 |
| 256 void PlatformDisplayDefault::OnAcceleratedWidgetDestroyed() { | 278 void PlatformDisplayDefault::OnAcceleratedWidgetDestroyed() { |
| 257 NOTREACHED(); | 279 NOTREACHED(); |
| 258 } | 280 } |
| 259 | 281 |
| 260 void PlatformDisplayDefault::OnActivationChanged(bool active) {} | 282 void PlatformDisplayDefault::OnActivationChanged(bool active) {} |
| 261 | 283 |
| 262 bool PlatformDisplayDefault::IsInHighContrastMode() { | 284 bool PlatformDisplayDefault::IsInHighContrastMode() { |
| 263 return delegate_ ? delegate_->IsInHighContrastMode() : false; | 285 return delegate_ ? delegate_->IsInHighContrastMode() : false; |
| 264 } | 286 } |
| 265 | 287 |
| 266 } // namespace ws | 288 } // namespace ws |
| 267 } // namespace ui | 289 } // namespace ui |
| OLD | NEW |