| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 gfx::Size frame_size = last_submitted_frame_size_; | 85 gfx::Size frame_size = last_submitted_frame_size_; |
| 86 if (!frame.render_pass_list.empty()) | 86 if (!frame.render_pass_list.empty()) |
| 87 frame_size = frame.render_pass_list[0]->output_rect.size(); | 87 frame_size = frame.render_pass_list[0]->output_rect.size(); |
| 88 | 88 |
| 89 if (!local_surface_id_.is_valid() || | 89 if (!local_surface_id_.is_valid() || |
| 90 frame_size != last_submitted_frame_size_) { | 90 frame_size != last_submitted_frame_size_) { |
| 91 local_surface_id_ = id_allocator_.GenerateId(); | 91 local_surface_id_ = id_allocator_.GenerateId(); |
| 92 display_private_->ResizeDisplay(frame_size); | 92 display_private_->ResizeDisplay(frame_size); |
| 93 } | 93 } |
| 94 | 94 |
| 95 display_private_->SetLocalSurfaceId(local_surface_id_, |
| 96 device_scale_factor_); |
| 95 compositor_frame_sink_->SubmitCompositorFrame(local_surface_id_, | 97 compositor_frame_sink_->SubmitCompositorFrame(local_surface_id_, |
| 96 std::move(frame)); | 98 std::move(frame)); |
| 97 compositor_frame_sink_->SetNeedsBeginFrame(false); | 99 compositor_frame_sink_->SetNeedsBeginFrame(false); |
| 98 last_submitted_frame_size_ = frame_size; | 100 last_submitted_frame_size_ = frame_size; |
| 99 } | 101 } |
| 100 } | 102 } |
| 101 | 103 |
| 102 void FrameGenerator::ReclaimResources( | 104 void FrameGenerator::ReclaimResources( |
| 103 const cc::ReturnedResourceArray& resources) { | 105 const cc::ReturnedResourceArray& resources) { |
| 104 // Nothing to do here because FrameGenerator CompositorFrames don't reference | 106 // Nothing to do here because FrameGenerator CompositorFrames don't reference |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 0 /* sorting-context_id */); | 178 0 /* sorting-context_id */); |
| 177 auto* quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); | 179 auto* quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); |
| 178 quad->SetAll(sqs, bounds_at_origin /* rect */, gfx::Rect() /* opaque_rect */, | 180 quad->SetAll(sqs, bounds_at_origin /* rect */, gfx::Rect() /* opaque_rect */, |
| 179 bounds_at_origin /* visible_rect */, true /* needs_blending*/, | 181 bounds_at_origin /* visible_rect */, true /* needs_blending*/, |
| 180 window_manager_surface_info_.id()); | 182 window_manager_surface_info_.id()); |
| 181 } | 183 } |
| 182 | 184 |
| 183 } // namespace ws | 185 } // namespace ws |
| 184 | 186 |
| 185 } // namespace ui | 187 } // namespace ui |
| OLD | NEW |