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

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

Issue 2760433002: SurfaceManager::CreateSurface must set the surface's factory (Closed)
Patch Set: Reset Created 3 years, 9 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_manager.cc » ('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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // Remove existing CopyOutputRequests made on the Surface by the same 114 // Remove existing CopyOutputRequests made on the Surface by the same
115 // source. 115 // source.
116 base::EraseIf(copy_requests, 116 base::EraseIf(copy_requests,
117 [&source](const std::unique_ptr<CopyOutputRequest>& x) { 117 [&source](const std::unique_ptr<CopyOutputRequest>& x) {
118 return x->has_source() && x->source() == source; 118 return x->has_source() && x->source() == source;
119 }); 119 });
120 } 120 }
121 copy_requests.push_back(std::move(copy_request)); 121 copy_requests.push_back(std::move(copy_request));
122 } 122 }
123 123
124 void Surface::Reset() {
125 active_frame_.reset();
126 pending_frame_.reset();
127 blocking_surfaces_.clear();
128 RunDrawCallbacks();
129 }
130
124 void Surface::NotifySurfaceIdAvailable(const SurfaceId& surface_id) { 131 void Surface::NotifySurfaceIdAvailable(const SurfaceId& surface_id) {
125 auto it = blocking_surfaces_.find(surface_id); 132 auto it = blocking_surfaces_.find(surface_id);
126 // This surface may no longer have blockers if the deadline has passed. 133 // This surface may no longer have blockers if the deadline has passed.
127 if (it == blocking_surfaces_.end()) 134 if (it == blocking_surfaces_.end())
128 return; 135 return;
129 136
130 blocking_surfaces_.erase(it); 137 blocking_surfaces_.erase(it);
131 138
132 if (!blocking_surfaces_.empty()) 139 if (!blocking_surfaces_.empty())
133 return; 140 return;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 frame->metadata.latency_info.swap(*latency_info); 346 frame->metadata.latency_info.swap(*latency_info);
340 return; 347 return;
341 } 348 }
342 std::copy(frame->metadata.latency_info.begin(), 349 std::copy(frame->metadata.latency_info.begin(),
343 frame->metadata.latency_info.end(), 350 frame->metadata.latency_info.end(),
344 std::back_inserter(*latency_info)); 351 std::back_inserter(*latency_info));
345 frame->metadata.latency_info.clear(); 352 frame->metadata.latency_info.clear();
346 } 353 }
347 354
348 } // namespace cc 355 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface.h ('k') | cc/surfaces/surface_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698