| 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 "cc/surfaces/surface.h" | 5 #include "cc/surfaces/surface.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 for (const auto& render_pass : current_frame_->render_pass_list) { | 109 for (const auto& render_pass : current_frame_->render_pass_list) { |
| 110 for (auto& request : render_pass->copy_requests) { | 110 for (auto& request : render_pass->copy_requests) { |
| 111 copy_requests->insert( | 111 copy_requests->insert( |
| 112 std::make_pair(render_pass->id, std::move(request))); | 112 std::make_pair(render_pass->id, std::move(request))); |
| 113 } | 113 } |
| 114 render_pass->copy_requests.clear(); | 114 render_pass->copy_requests.clear(); |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 | 118 |
| 119 const CompositorFrame& Surface::GetEligibleFrame() { | 119 const CompositorFrame& Surface::GetEligibleFrame() const { |
| 120 DCHECK(current_frame_); | 120 DCHECK(current_frame_); |
| 121 return current_frame_.value(); | 121 return current_frame_.value(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void Surface::TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info) { | 124 void Surface::TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info) { |
| 125 if (!current_frame_) | 125 if (!current_frame_) |
| 126 return; | 126 return; |
| 127 if (latency_info->empty()) { | 127 if (latency_info->empty()) { |
| 128 current_frame_->metadata.latency_info.swap(*latency_info); | 128 current_frame_->metadata.latency_info.swap(*latency_info); |
| 129 return; | 129 return; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 void Surface::ClearCopyRequests() { | 171 void Surface::ClearCopyRequests() { |
| 172 if (current_frame_) { | 172 if (current_frame_) { |
| 173 for (const auto& render_pass : current_frame_->render_pass_list) { | 173 for (const auto& render_pass : current_frame_->render_pass_list) { |
| 174 for (const auto& copy_request : render_pass->copy_requests) | 174 for (const auto& copy_request : render_pass->copy_requests) |
| 175 copy_request->SendEmptyResult(); | 175 copy_request->SendEmptyResult(); |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace cc | 180 } // namespace cc |
| OLD | NEW |