Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module cc.mojom; | 5 module cc.mojom; |
| 6 | 6 |
| 7 import "cc/ipc/begin_frame_args.mojom"; | 7 import "cc/ipc/begin_frame_args.mojom"; |
| 8 import "cc/ipc/compositor_frame.mojom"; | 8 import "cc/ipc/compositor_frame.mojom"; |
| 9 import "cc/ipc/copy_output_request.mojom"; | |
| 10 import "cc/ipc/copy_output_result.mojom"; | |
| 9 import "cc/ipc/frame_sink_id.mojom"; | 11 import "cc/ipc/frame_sink_id.mojom"; |
| 10 import "cc/ipc/local_surface_id.mojom"; | 12 import "cc/ipc/local_surface_id.mojom"; |
| 11 import "cc/ipc/surface_reference.mojom"; | 13 import "cc/ipc/surface_reference.mojom"; |
| 12 import "cc/ipc/returned_resource.mojom"; | 14 import "cc/ipc/returned_resource.mojom"; |
| 13 import "cc/ipc/surface_sequence.mojom"; | 15 import "cc/ipc/surface_sequence.mojom"; |
| 16 import "gpu/ipc/common/mailbox.mojom"; | |
| 17 import "gpu/ipc/common/sync_token.mojom"; | |
| 14 | 18 |
| 15 // A MojoCompositorFrameSink is an interface for receiving CompositorFrame | 19 // A MojoCompositorFrameSink is an interface for receiving CompositorFrame |
| 16 // structs. A CompositorFrame contains the complete output meant for display. | 20 // structs. A CompositorFrame contains the complete output meant for display. |
| 17 // Each time a client has a graphical update, and receives an OnBeginFrame, it | 21 // Each time a client has a graphical update, and receives an OnBeginFrame, it |
| 18 // is responsible for creating a CompositorFrame to update its portion of the | 22 // is responsible for creating a CompositorFrame to update its portion of the |
| 19 // screen. | 23 // screen. |
| 20 interface MojoCompositorFrameSink { | 24 interface MojoCompositorFrameSink { |
| 21 // Lets the display compositor know that the client wishes to receive the next | 25 // Lets the display compositor know that the client wishes to receive the next |
| 22 // BeginFrame event. | 26 // BeginFrame event. |
| 23 SetNeedsBeginFrame(bool needs_begin_frame); | 27 SetNeedsBeginFrame(bool needs_begin_frame); |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 39 | 43 |
| 40 // TODO(staraz): Delete Require() and Satisfy() once surface references | 44 // TODO(staraz): Delete Require() and Satisfy() once surface references |
| 41 // (CL 2541683004) are ready. | 45 // (CL 2541683004) are ready. |
| 42 // Add the provided |sequence| as a destruction dependency of the | 46 // Add the provided |sequence| as a destruction dependency of the |
| 43 // surface associated with the provided |local_surface_id|. | 47 // surface associated with the provided |local_surface_id|. |
| 44 Require(cc.mojom.LocalSurfaceId local_surface_id, | 48 Require(cc.mojom.LocalSurfaceId local_surface_id, |
| 45 cc.mojom.SurfaceSequence sequence); | 49 cc.mojom.SurfaceSequence sequence); |
| 46 | 50 |
| 47 // Mark the sequence as satisfied and garbage collect surfaces. | 51 // Mark the sequence as satisfied and garbage collect surfaces. |
| 48 Satisfy(cc.mojom.SurfaceSequence sequence); | 52 Satisfy(cc.mojom.SurfaceSequence sequence); |
| 49 | |
| 50 // TODO(fsamuel): ReadbackBitmap API would be useful here. | |
| 51 }; | 53 }; |
| 52 | 54 |
| 53 interface MojoCompositorFrameSinkClient { | 55 interface MojoCompositorFrameSinkClient { |
| 54 // Notification that the previous CompositorFrame given to | 56 // Notification that the previous CompositorFrame given to |
| 55 // SubmitCompositorFrame() has been processed and that another frame | 57 // SubmitCompositorFrame() has been processed and that another frame |
| 56 // can be submitted. This provides backpressure from the display compositor | 58 // can be submitted. This provides backpressure from the display compositor |
| 57 // so that frames are submitted only at the rate it can handle them. | 59 // so that frames are submitted only at the rate it can handle them. |
| 58 // TODO(fsamuel): This method ought not be necessary with unified BeginFrame. | 60 // TODO(fsamuel): This method ought not be necessary with unified BeginFrame. |
| 59 // However, there's a fair amount of cleanup and refactoring necessary to get | 61 // However, there's a fair amount of cleanup and refactoring necessary to get |
| 60 // rid of it. | 62 // rid of it. |
| 61 DidReceiveCompositorFrameAck(); | 63 DidReceiveCompositorFrameAck(); |
| 62 | 64 |
| 63 // Notification for the client to generate a CompositorFrame. | 65 // Notification for the client to generate a CompositorFrame. |
| 64 OnBeginFrame(BeginFrameArgs args); | 66 OnBeginFrame(BeginFrameArgs args); |
| 65 | 67 |
| 66 // Returns resources sent to SubmitCompositorFrame to be reused or freed. | 68 // Returns resources sent to SubmitCompositorFrame to be reused or freed. |
| 67 ReclaimResources(ReturnedResourceArray resources); | 69 ReclaimResources(ReturnedResourceArray resources); |
| 68 | 70 |
| 69 // Called when surface is being scheduled for a draw. | 71 // Called when surface is being scheduled for a draw. |
| 70 WillDrawSurface(); | 72 WillDrawSurface(); |
| 71 }; | 73 }; |
| 72 | 74 |
| 73 // MojoCompositorFrameSinkPrivate is used by the display compositor host to set | 75 // MojoCompositorFrameSinkPrivate is used by the display compositor host to set |
| 74 // up BeginFrameSource hierarchies. This API lives in SurfaceManager but is | 76 // up BeginFrameSource hierarchies. This API lives in SurfaceManager but is |
| 75 // called from here in order to ensure that hierarchy registration does not race | 77 // called from here in order to ensure that hierarchy registration does not race |
| 76 // CompositorFrameSink creation. | 78 // CompositorFrameSink creation. |
| 77 interface MojoCompositorFrameSinkPrivate { | 79 interface MojoCompositorFrameSinkPrivate { |
| 78 AddChildFrameSink(FrameSinkId child_frame_sink_id); | 80 AddChildFrameSink(FrameSinkId child_frame_sink_id); |
| 79 RemoveChildFrameSink(FrameSinkId child_frame_sink_id); | 81 RemoveChildFrameSink(FrameSinkId child_frame_sink_id); |
| 82 | |
| 83 // Requests that the renderer send back a copy of the surface that this | |
| 84 // CompositorFrameSink submits to. The result can be in form of a bitmap | |
| 85 // or a texture. See cc::CopyOutputRequest and cc::CopyOutputResult. | |
| 86 RequestCopyOfSurface(cc.mojom.CopyOutputRequest request) | |
| 87 => (cc.mojom.CopyOutputResult result); | |
| 88 | |
| 89 // 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.
| |
| 90 // must be used to release it. | |
| 91 ReleaseCopyOfSurface(gpu.mojom.Mailbox mailbox, | |
| 92 gpu.mojom.SyncToken sync_token, bool is_lost); | |
| 80 }; | 93 }; |
| OLD | NEW |