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

Unified Diff: cc/surfaces/surface_manager.cc

Issue 2614423003: Adding SatisfySequence and RequireSequence to SurfaceManager (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 side-by-side diff with in-line comments
Download patch
Index: cc/surfaces/surface_manager.cc
diff --git a/cc/surfaces/surface_manager.cc b/cc/surfaces/surface_manager.cc
index 34bd3948255f19625156ef54b0b5bdc6ae80e388..c07a9189c30bde3b3045886cf0b86653eb75fee5 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) {
+ LOG(ERROR) << "Attempting to require callback on nonexistent surface";
danakj 2017/01/09 19:07:43 We don't usually put LOGs in code that we ship, I'
+ 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();
}

Powered by Google App Engine
This is Rietveld 408576698