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/ipc/quads.mojom.h" | 9 #include "cc/ipc/quads.mojom.h" |
10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 DefaultPlatformDisplay::GenerateCompositorFrame() { | 310 DefaultPlatformDisplay::GenerateCompositorFrame() { |
311 std::unique_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create(); | 311 std::unique_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create(); |
312 render_pass->damage_rect = dirty_rect_; | 312 render_pass->damage_rect = dirty_rect_; |
313 render_pass->output_rect = gfx::Rect(metrics_.size_in_pixels); | 313 render_pass->output_rect = gfx::Rect(metrics_.size_in_pixels); |
314 | 314 |
315 DrawWindowTree(render_pass.get(), delegate_->GetRootWindow(), gfx::Vector2d(), | 315 DrawWindowTree(render_pass.get(), delegate_->GetRootWindow(), gfx::Vector2d(), |
316 1.0f); | 316 1.0f); |
317 | 317 |
318 std::unique_ptr<cc::DelegatedFrameData> frame_data( | 318 std::unique_ptr<cc::DelegatedFrameData> frame_data( |
319 new cc::DelegatedFrameData); | 319 new cc::DelegatedFrameData); |
320 frame_data->device_scale_factor = metrics_.device_scale_factor; | |
321 frame_data->render_pass_list.push_back(std::move(render_pass)); | 320 frame_data->render_pass_list.push_back(std::move(render_pass)); |
322 | 321 |
323 std::unique_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); | 322 std::unique_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); |
324 frame->delegated_frame_data = std::move(frame_data); | 323 frame->delegated_frame_data = std::move(frame_data); |
325 return frame; | 324 return frame; |
326 } | 325 } |
327 | 326 |
328 void DefaultPlatformDisplay::OnBoundsChanged(const gfx::Rect& new_bounds) { | 327 void DefaultPlatformDisplay::OnBoundsChanged(const gfx::Rect& new_bounds) { |
329 UpdateMetrics(new_bounds.size(), metrics_.device_scale_factor); | 328 UpdateMetrics(new_bounds.size(), metrics_.device_scale_factor); |
330 } | 329 } |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 | 406 |
408 void DefaultPlatformDisplay::RequestCopyOfOutput( | 407 void DefaultPlatformDisplay::RequestCopyOfOutput( |
409 std::unique_ptr<cc::CopyOutputRequest> output_request) { | 408 std::unique_ptr<cc::CopyOutputRequest> output_request) { |
410 if (display_compositor_) | 409 if (display_compositor_) |
411 display_compositor_->RequestCopyOfOutput(std::move(output_request)); | 410 display_compositor_->RequestCopyOfOutput(std::move(output_request)); |
412 } | 411 } |
413 | 412 |
414 } // namespace ws | 413 } // namespace ws |
415 | 414 |
416 } // namespace mus | 415 } // namespace mus |
OLD | NEW |