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

Unified Diff: cc/surfaces/surface_manager.cc

Issue 2614423003: Adding SatisfySequence and RequireSequence to SurfaceManager (Closed)
Patch Set: up 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/surfaces/surface_manager.h ('k') | cc/surfaces/surface_manager_ref_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_manager.cc
diff --git a/cc/surfaces/surface_manager.cc b/cc/surfaces/surface_manager.cc
index 34bd3948255f19625156ef54b0b5bdc6ae80e388..c4dcc5b46cf5eb58a3ee195ddbba829760429155 100644
--- a/cc/surfaces/surface_manager.cc
+++ b/cc/surfaces/surface_manager.cc
@@ -77,13 +77,20 @@ void SurfaceManager::Destroy(std::unique_ptr<Surface> surface) {
GarbageCollectSurfaces();
}
-void SurfaceManager::DidSatisfySequences(const FrameSinkId& frame_sink_id,
- std::vector<uint32_t>* sequence) {
+void SurfaceManager::RequireSequence(const SurfaceId& surface_id,
+ const SurfaceSequence& sequence) {
+ auto* surface = GetSurfaceForId(surface_id);
+ if (!surface) {
+ DLOG(ERROR) << "Attempting to require callback on nonexistent surface";
danakj 2017/01/09 19:27:10 Maybe mention in a comment that this can occur fro
+ return;
+ }
+ surface->AddDestructionDependency(sequence);
+}
+
+void SurfaceManager::SatisfySequence(const SurfaceSequence& sequence) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK_EQ(lifetime_type_, LifetimeType::SEQUENCES);
- for (uint32_t value : *sequence)
- satisfied_sequences_.insert(SurfaceSequence(frame_sink_id, value));
- sequence->clear();
+ satisfied_sequences_.insert(sequence);
GarbageCollectSurfaces();
}
« no previous file with comments | « cc/surfaces/surface_manager.h ('k') | cc/surfaces/surface_manager_ref_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698