| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 factory_->manager()->RequestSurfaceResolution(this); | 72 factory_->manager()->RequestSurfaceResolution(this); |
| 73 } else { | 73 } else { |
| 74 // If there are no blockers, then immediately activate the frame. | 74 // If there are no blockers, then immediately activate the frame. |
| 75 ActivateFrame(FrameData(std::move(frame), callback)); | 75 ActivateFrame(FrameData(std::move(frame), callback)); |
| 76 } | 76 } |
| 77 | 77 |
| 78 // Returns resources for the previous pending frame. | 78 // Returns resources for the previous pending frame. |
| 79 UnrefFrameResourcesAndRunDrawCallback(std::move(previous_pending_frame_data)); | 79 UnrefFrameResourcesAndRunDrawCallback(std::move(previous_pending_frame_data)); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void Surface::EvictFrame() { | |
| 83 QueueFrame(CompositorFrame(), DrawCallback()); | |
| 84 active_frame_data_.reset(); | |
| 85 } | |
| 86 | |
| 87 void Surface::RequestCopyOfOutput( | 82 void Surface::RequestCopyOfOutput( |
| 88 std::unique_ptr<CopyOutputRequest> copy_request) { | 83 std::unique_ptr<CopyOutputRequest> copy_request) { |
| 89 if (!active_frame_data_ || | 84 if (!active_frame_data_ || |
| 90 active_frame_data_->frame.render_pass_list.empty()) { | 85 active_frame_data_->frame.render_pass_list.empty()) { |
| 91 copy_request->SendEmptyResult(); | 86 copy_request->SendEmptyResult(); |
| 92 return; | 87 return; |
| 93 } | 88 } |
| 94 | 89 |
| 95 std::vector<std::unique_ptr<CopyOutputRequest>>& copy_requests = | 90 std::vector<std::unique_ptr<CopyOutputRequest>>& copy_requests = |
| 96 active_frame_data_->frame.render_pass_list.back()->copy_requests; | 91 active_frame_data_->frame.render_pass_list.back()->copy_requests; |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 frame->metadata.latency_info.swap(*latency_info); | 332 frame->metadata.latency_info.swap(*latency_info); |
| 338 return; | 333 return; |
| 339 } | 334 } |
| 340 std::copy(frame->metadata.latency_info.begin(), | 335 std::copy(frame->metadata.latency_info.begin(), |
| 341 frame->metadata.latency_info.end(), | 336 frame->metadata.latency_info.end(), |
| 342 std::back_inserter(*latency_info)); | 337 std::back_inserter(*latency_info)); |
| 343 frame->metadata.latency_info.clear(); | 338 frame->metadata.latency_info.clear(); |
| 344 } | 339 } |
| 345 | 340 |
| 346 } // namespace cc | 341 } // namespace cc |
| OLD | NEW |