| 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 "components/mus/ws/platform_display.h" | 5 #include "components/mus/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/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
| 10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 delegate_->OnNativeCaptureLost(); | 416 delegate_->OnNativeCaptureLost(); |
| 417 } | 417 } |
| 418 | 418 |
| 419 void DefaultPlatformDisplay::OnAcceleratedWidgetAvailable( | 419 void DefaultPlatformDisplay::OnAcceleratedWidgetAvailable( |
| 420 gfx::AcceleratedWidget widget, | 420 gfx::AcceleratedWidget widget, |
| 421 float device_pixel_ratio) { | 421 float device_pixel_ratio) { |
| 422 if (widget != gfx::kNullAcceleratedWidget) { | 422 if (widget != gfx::kNullAcceleratedWidget) { |
| 423 display_compositor_.reset( | 423 display_compositor_.reset( |
| 424 new DisplayCompositor(base::ThreadTaskRunnerHandle::Get(), widget, | 424 new DisplayCompositor(base::ThreadTaskRunnerHandle::Get(), widget, |
| 425 gpu_state_, surfaces_state_)); | 425 gpu_state_, surfaces_state_)); |
| 426 delegate_->OnTopLevelSurfaceChanged(display_compositor_->surface_id()); | |
| 427 } | 426 } |
| 428 UpdateMetrics(metrics_.size_in_pixels.To<gfx::Size>(), device_pixel_ratio); | 427 UpdateMetrics(metrics_.size_in_pixels.To<gfx::Size>(), device_pixel_ratio); |
| 429 } | 428 } |
| 430 | 429 |
| 431 void DefaultPlatformDisplay::OnAcceleratedWidgetDestroyed() { | 430 void DefaultPlatformDisplay::OnAcceleratedWidgetDestroyed() { |
| 432 NOTREACHED(); | 431 NOTREACHED(); |
| 433 } | 432 } |
| 434 | 433 |
| 435 void DefaultPlatformDisplay::OnActivationChanged(bool active) {} | 434 void DefaultPlatformDisplay::OnActivationChanged(bool active) {} |
| 436 | 435 |
| 437 void DefaultPlatformDisplay::RequestCopyOfOutput( | 436 void DefaultPlatformDisplay::RequestCopyOfOutput( |
| 438 std::unique_ptr<cc::CopyOutputRequest> output_request) { | 437 std::unique_ptr<cc::CopyOutputRequest> output_request) { |
| 439 if (display_compositor_) | 438 if (display_compositor_) |
| 440 display_compositor_->RequestCopyOfOutput(std::move(output_request)); | 439 display_compositor_->RequestCopyOfOutput(std::move(output_request)); |
| 441 } | 440 } |
| 442 | 441 |
| 443 } // namespace ws | 442 } // namespace ws |
| 444 | 443 |
| 445 } // namespace mus | 444 } // namespace mus |
| OLD | NEW |