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

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

Issue 2609253003: Remove ForceReclaimResources (Closed)
Patch Set: Make test cases / phases the same 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
83 void Surface::RequestCopyOfOutput( 78 void Surface::RequestCopyOfOutput(
84 std::unique_ptr<CopyOutputRequest> copy_request) { 79 std::unique_ptr<CopyOutputRequest> copy_request) {
85 if (current_frame_ && !current_frame_->render_pass_list.empty()) { 80 if (current_frame_ && !current_frame_->render_pass_list.empty()) {
86 std::vector<std::unique_ptr<CopyOutputRequest>>& copy_requests = 81 std::vector<std::unique_ptr<CopyOutputRequest>>& copy_requests =
87 current_frame_->render_pass_list.back()->copy_requests; 82 current_frame_->render_pass_list.back()->copy_requests;
88 83
89 if (void* source = copy_request->source()) { 84 if (void* source = copy_request->source()) {
90 // Remove existing CopyOutputRequests made on the Surface by the same 85 // Remove existing CopyOutputRequests made on the Surface by the same
91 // source. 86 // source.
92 auto to_remove = 87 auto to_remove =
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 void Surface::ClearCopyRequests() { 166 void Surface::ClearCopyRequests() {
172 if (current_frame_) { 167 if (current_frame_) {
173 for (const auto& render_pass : current_frame_->render_pass_list) { 168 for (const auto& render_pass : current_frame_->render_pass_list) {
174 for (const auto& copy_request : render_pass->copy_requests) 169 for (const auto& copy_request : render_pass->copy_requests)
175 copy_request->SendEmptyResult(); 170 copy_request->SendEmptyResult();
176 } 171 }
177 } 172 }
178 } 173 }
179 174
180 } // namespace cc 175 } // 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