 Chromium Code Reviews
 Chromium Code Reviews Issue 2676353002:
  MojoCompositorFrameSinkPrivate should support copy requests  (Closed)
    
  
    Issue 2676353002:
  MojoCompositorFrameSinkPrivate should support copy requests  (Closed) 
  | Index: cc/ipc/mojo_compositor_frame_sink.mojom | 
| diff --git a/cc/ipc/mojo_compositor_frame_sink.mojom b/cc/ipc/mojo_compositor_frame_sink.mojom | 
| index bf2e196f79956523a6f3e578a2decc796cd35959..1826ca8a2da795e89d962a782ed6c2bce4d35daa 100644 | 
| --- a/cc/ipc/mojo_compositor_frame_sink.mojom | 
| +++ b/cc/ipc/mojo_compositor_frame_sink.mojom | 
| @@ -6,11 +6,15 @@ module cc.mojom; | 
| import "cc/ipc/begin_frame_args.mojom"; | 
| import "cc/ipc/compositor_frame.mojom"; | 
| +import "cc/ipc/copy_output_request.mojom"; | 
| +import "cc/ipc/copy_output_result.mojom"; | 
| import "cc/ipc/frame_sink_id.mojom"; | 
| import "cc/ipc/local_surface_id.mojom"; | 
| import "cc/ipc/surface_reference.mojom"; | 
| import "cc/ipc/returned_resource.mojom"; | 
| import "cc/ipc/surface_sequence.mojom"; | 
| +import "gpu/ipc/common/mailbox.mojom"; | 
| +import "gpu/ipc/common/sync_token.mojom"; | 
| // A MojoCompositorFrameSink is an interface for receiving CompositorFrame | 
| // structs. A CompositorFrame contains the complete output meant for display. | 
| @@ -46,8 +50,6 @@ interface MojoCompositorFrameSink { | 
| // Mark the sequence as satisfied and garbage collect surfaces. | 
| Satisfy(cc.mojom.SurfaceSequence sequence); | 
| - | 
| - // TODO(fsamuel): ReadbackBitmap API would be useful here. | 
| }; | 
| interface MojoCompositorFrameSinkClient { | 
| @@ -77,4 +79,15 @@ interface MojoCompositorFrameSinkClient { | 
| interface MojoCompositorFrameSinkPrivate { | 
| AddChildFrameSink(FrameSinkId child_frame_sink_id); | 
| RemoveChildFrameSink(FrameSinkId child_frame_sink_id); | 
| + | 
| + // Requests that the renderer send back a copy of the surface that this | 
| + // CompositorFrameSink submits to. The result can be in form of a bitmap | 
| + // or a texture. See cc::CopyOutputRequest and cc::CopyOutputResult. | 
| + RequestCopyOfSurface(cc.mojom.CopyOutputRequest request) | 
| + => (cc.mojom.CopyOutputResult result); | 
| + | 
| + // If the copy returned by RequestCopyOfSurface is a texture, this method | 
| 
danakj
2017/02/06 23:02:12
This might be off-topic but what if it's a bitmap,
 
Saman Sami
2017/02/06 23:09:54
We serialize the bitmap and send it over IPC. I'm
 
danakj
2017/02/06 23:24:07
Yeh it would have to. We should do that cuz copyin
 
Saman Sami
2017/02/13 23:07:37
I agree. I created a new bug to track this issue.
 | 
| + // must be used to release it. | 
| + ReleaseCopyOfSurface(gpu.mojom.Mailbox mailbox, | 
| + gpu.mojom.SyncToken sync_token, bool is_lost); | 
| }; |