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

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

Issue 2633563003: Revert of Remove ForceReclaimResources (Closed)
Patch Set: Created 3 years, 11 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 if (previous_frame) 68 if (previous_frame)
69 UnrefFrameResources(*previous_frame); 69 UnrefFrameResources(*previous_frame);
70 70
71 if (!draw_callback_.is_null()) 71 if (!draw_callback_.is_null())
72 draw_callback_.Run(); 72 draw_callback_.Run();
73 draw_callback_ = callback; 73 draw_callback_ = callback;
74 74
75 referenced_surfaces_ = current_frame_->metadata.referenced_surfaces; 75 referenced_surfaces_ = current_frame_->metadata.referenced_surfaces;
76 } 76 }
77 77
78 void Surface::EvictFrame() {
79 QueueFrame(CompositorFrame(), DrawCallback());
80 current_frame_.reset();
81 }
82
78 void Surface::RequestCopyOfOutput( 83 void Surface::RequestCopyOfOutput(
79 std::unique_ptr<CopyOutputRequest> copy_request) { 84 std::unique_ptr<CopyOutputRequest> copy_request) {
80 if (current_frame_ && !current_frame_->render_pass_list.empty()) { 85 if (current_frame_ && !current_frame_->render_pass_list.empty()) {
81 std::vector<std::unique_ptr<CopyOutputRequest>>& copy_requests = 86 std::vector<std::unique_ptr<CopyOutputRequest>>& copy_requests =
82 current_frame_->render_pass_list.back()->copy_requests; 87 current_frame_->render_pass_list.back()->copy_requests;
83 88
84 if (void* source = copy_request->source()) { 89 if (void* source = copy_request->source()) {
85 // Remove existing CopyOutputRequests made on the Surface by the same 90 // Remove existing CopyOutputRequests made on the Surface by the same
86 // source. 91 // source.
87 auto to_remove = 92 auto to_remove =
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 void Surface::ClearCopyRequests() { 171 void Surface::ClearCopyRequests() {
167 if (current_frame_) { 172 if (current_frame_) {
168 for (const auto& render_pass : current_frame_->render_pass_list) { 173 for (const auto& render_pass : current_frame_->render_pass_list) {
169 for (const auto& copy_request : render_pass->copy_requests) 174 for (const auto& copy_request : render_pass->copy_requests)
170 copy_request->SendEmptyResult(); 175 copy_request->SendEmptyResult();
171 } 176 }
172 } 177 }
173 } 178 }
174 179
175 } // namespace cc 180 } // 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