Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(756)

Side by Side Diff: cc/surfaces/surface.cc

Issue 2822143003: Remove ForceReclaimResources (Closed)
Patch Set: Change to RunLoop. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/surfaces/surface.h ('k') | cc/surfaces/surface_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/surfaces/surface.h ('k') | cc/surfaces/surface_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698