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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 factory_->manager()->RequestSurfaceResolution(this); | 75 factory_->manager()->RequestSurfaceResolution(this); |
76 } else { | 76 } else { |
77 // If there are no blockers, then immediately activate the frame. | 77 // If there are no blockers, then immediately activate the frame. |
78 ActivateFrame(FrameData(std::move(frame), callback, will_draw_callback)); | 78 ActivateFrame(FrameData(std::move(frame), callback, will_draw_callback)); |
79 } | 79 } |
80 | 80 |
81 // Returns resources for the previous pending frame. | 81 // Returns resources for the previous pending frame. |
82 UnrefFrameResourcesAndRunDrawCallback(std::move(previous_pending_frame_data)); | 82 UnrefFrameResourcesAndRunDrawCallback(std::move(previous_pending_frame_data)); |
83 } | 83 } |
84 | 84 |
85 void Surface::EvictFrame() { | |
86 QueueFrame(CompositorFrame(), DrawCallback(), WillDrawCallback()); | |
87 active_frame_data_.reset(); | |
88 } | |
89 | |
90 void Surface::RequestCopyOfOutput( | 85 void Surface::RequestCopyOfOutput( |
91 std::unique_ptr<CopyOutputRequest> copy_request) { | 86 std::unique_ptr<CopyOutputRequest> copy_request) { |
92 if (!active_frame_data_ || | 87 if (!active_frame_data_ || |
93 active_frame_data_->frame.render_pass_list.empty()) { | 88 active_frame_data_->frame.render_pass_list.empty()) { |
94 copy_request->SendEmptyResult(); | 89 copy_request->SendEmptyResult(); |
95 return; | 90 return; |
96 } | 91 } |
97 | 92 |
98 std::vector<std::unique_ptr<CopyOutputRequest>>& copy_requests = | 93 std::vector<std::unique_ptr<CopyOutputRequest>>& copy_requests = |
99 active_frame_data_->frame.render_pass_list.back()->copy_requests; | 94 active_frame_data_->frame.render_pass_list.back()->copy_requests; |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 frame->metadata.latency_info.swap(*latency_info); | 346 frame->metadata.latency_info.swap(*latency_info); |
352 return; | 347 return; |
353 } | 348 } |
354 std::copy(frame->metadata.latency_info.begin(), | 349 std::copy(frame->metadata.latency_info.begin(), |
355 frame->metadata.latency_info.end(), | 350 frame->metadata.latency_info.end(), |
356 std::back_inserter(*latency_info)); | 351 std::back_inserter(*latency_info)); |
357 frame->metadata.latency_info.clear(); | 352 frame->metadata.latency_info.clear(); |
358 } | 353 } |
359 | 354 |
360 } // namespace cc | 355 } // namespace cc |
OLD | NEW |