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

Unified Diff: cc/surfaces/compositor_frame_sink_support.h

Issue 2676353002: MojoCompositorFrameSinkPrivate should support copy requests (Closed)
Patch Set: c Created 3 years, 10 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/compositor_frame_sink_support.h
diff --git a/cc/surfaces/compositor_frame_sink_support.h b/cc/surfaces/compositor_frame_sink_support.h
index 8471bbd15c6b186b1c4678f6f64a7246ab41fd18..d2fa5d6d83d0f92c625e08eccf3da6d425345b0e 100644
--- a/cc/surfaces/compositor_frame_sink_support.h
+++ b/cc/surfaces/compositor_frame_sink_support.h
@@ -8,6 +8,8 @@
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "cc/output/compositor_frame.h"
+#include "cc/output/copy_output_request.h"
+#include "cc/output/copy_output_result.h"
#include "cc/scheduler/begin_frame_source.h"
#include "cc/surfaces/display.h"
#include "cc/surfaces/display_client.h"
@@ -46,12 +48,19 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport
void Satisfy(const SurfaceSequence& sequence);
void AddChildFrameSink(const FrameSinkId& child_frame_sink_id);
void RemoveChildFrameSink(const FrameSinkId& child_frame_sink_id);
+ void RequestCopyOfSurface(std::unique_ptr<CopyOutputRequest> request);
+ void ReleaseCopyOfSurface(const gpu::Mailbox& mailbox,
+ const gpu::SyncToken& sync_token,
+ bool is_lost);
Display* display() { return display_.get(); }
private:
void DidReceiveCompositorFrameAck();
+ void OnTextureReceived(CopyOutputRequest::CopyOutputRequestCallback callback,
+ std::unique_ptr<CopyOutputResult> result);
+
// DisplayClient implementation.
void DisplayOutputSurfaceLost() override;
void DisplayWillDrawAndSwap(bool will_draw_and_swap,
@@ -104,6 +113,9 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport
// The set of BeginFrame children of this CompositorFrameSink.
std::unordered_set<FrameSinkId, FrameSinkIdHash> child_frame_sinks_;
+ std::map<gpu::Mailbox, std::unique_ptr<SingleReleaseCallback>>
+ release_callbacks_;
+
base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport);

Powered by Google App Engine
This is Rietveld 408576698