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/frame_generator.h" | 5 #include "services/ui/ws/frame_generator.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/containers/adapters.h" | 10 #include "base/containers/adapters.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 gfx::Size frame_size = last_submitted_frame_size_; | 75 gfx::Size frame_size = last_submitted_frame_size_; |
76 if (!frame.render_pass_list.empty()) | 76 if (!frame.render_pass_list.empty()) |
77 frame_size = frame.render_pass_list.back()->output_rect.size(); | 77 frame_size = frame.render_pass_list.back()->output_rect.size(); |
78 | 78 |
79 if (!local_surface_id_.is_valid() || | 79 if (!local_surface_id_.is_valid() || |
80 frame_size != last_submitted_frame_size_) { | 80 frame_size != last_submitted_frame_size_) { |
81 local_surface_id_ = id_allocator_.GenerateId(); | 81 local_surface_id_ = id_allocator_.GenerateId(); |
82 display_private_->ResizeDisplay(frame_size); | 82 display_private_->ResizeDisplay(frame_size); |
83 } | 83 } |
84 | 84 |
85 display_private_->SetLocalSurfaceId(local_surface_id_, device_scale_factor_); | 85 display_private_->SetLocalSurfaceId(local_surface_id_); |
| 86 display_private_->SetDeviceScaleFactor(device_scale_factor_); |
86 compositor_frame_sink_->SubmitCompositorFrame(local_surface_id_, | 87 compositor_frame_sink_->SubmitCompositorFrame(local_surface_id_, |
87 std::move(frame)); | 88 std::move(frame)); |
88 compositor_frame_sink_->SetNeedsBeginFrame(false); | 89 compositor_frame_sink_->SetNeedsBeginFrame(false); |
89 last_submitted_frame_size_ = frame_size; | 90 last_submitted_frame_size_ = frame_size; |
90 } | 91 } |
91 | 92 |
92 void FrameGenerator::ReclaimResources( | 93 void FrameGenerator::ReclaimResources( |
93 const cc::ReturnedResourceArray& resources) { | 94 const cc::ReturnedResourceArray& resources) { |
94 // Nothing to do here because FrameGenerator CompositorFrames don't reference | 95 // Nothing to do here because FrameGenerator CompositorFrames don't reference |
95 // any resources. | 96 // any resources. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 auto* quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); | 170 auto* quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); |
170 quad->SetAll(sqs, bounds_at_origin /* rect */, gfx::Rect() /* opaque_rect */, | 171 quad->SetAll(sqs, bounds_at_origin /* rect */, gfx::Rect() /* opaque_rect */, |
171 bounds_at_origin /* visible_rect */, true /* needs_blending*/, | 172 bounds_at_origin /* visible_rect */, true /* needs_blending*/, |
172 window_manager_surface_info_.id(), | 173 window_manager_surface_info_.id(), |
173 cc::SurfaceDrawQuadType::PRIMARY, nullptr); | 174 cc::SurfaceDrawQuadType::PRIMARY, nullptr); |
174 } | 175 } |
175 | 176 |
176 } // namespace ws | 177 } // namespace ws |
177 | 178 |
178 } // namespace ui | 179 } // namespace ui |
OLD | NEW |