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

Unified Diff: cc/surfaces/compositor_frame_sink_support.cc

Issue 2551083003: Add Satisfy() and Require() to MojoCompositorFrameSink (Closed)
Patch Set: Addressed comments Created 4 years 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/compositor_frame_sink_support.cc
diff --git a/cc/surfaces/compositor_frame_sink_support.cc b/cc/surfaces/compositor_frame_sink_support.cc
index 011d9a091583d27ac07bb3598771baae74a3fc0a..4cd83354e60aeb706bcb1c287d7819450eb88ff3 100644
--- a/cc/surfaces/compositor_frame_sink_support.cc
+++ b/cc/surfaces/compositor_frame_sink_support.cc
@@ -8,6 +8,7 @@
#include "cc/scheduler/begin_frame_source.h"
#include "cc/surfaces/compositor_frame_sink_support_client.h"
#include "cc/surfaces/display.h"
+#include "cc/surfaces/surface.h"
#include "cc/surfaces/surface_manager.h"
namespace cc {
@@ -78,6 +79,19 @@ void CompositorFrameSinkSupport::SubmitCompositorFrame(
}
}
+void CompositorFrameSinkSupport::Require(const LocalFrameId& local_frame_id,
+ const SurfaceSequence& sequence) {
+ Surface* surface = surface_manager_->GetSurfaceForId(
+ SurfaceId(frame_sink_id_, local_frame_id));
+ DCHECK(surface); // Ensure the surface exists before requiring callback
Fady Samuel 2016/12/06 16:45:25 nit: How about this comment? If this fails then
Alex Z. 2016/12/06 16:55:40 Done.
+ surface->AddDestructionDependency(sequence);
+}
+
+void CompositorFrameSinkSupport::Satisfy(const SurfaceSequence& sequence) {
+ std::vector<uint32_t> sequences = {sequence.sequence};
+ surface_manager_->DidSatisfySequences(sequence.frame_sink_id, &sequences);
+}
+
void CompositorFrameSinkSupport::DidReceiveCompositorFrameAck() {
DCHECK_GT(ack_pending_count_, 0);
ack_pending_count_--;
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support.h ('k') | content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698