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"; |
14 | 16 |
15 // A MojoCompositorFrameSink is an interface for receiving CompositorFrame | 17 // A MojoCompositorFrameSink is an interface for receiving CompositorFrame |
16 // structs. A CompositorFrame contains the complete output meant for display. | 18 // structs. A CompositorFrame contains the complete output meant for display. |
17 // Each time a client has a graphical update, and receives an OnBeginFrame, it | 19 // 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 | 20 // is responsible for creating a CompositorFrame to update its portion of the |
(...skipping 20 matching lines...) Expand all Loading... |
39 | 41 |
40 // TODO(staraz): Delete Require() and Satisfy() once surface references | 42 // TODO(staraz): Delete Require() and Satisfy() once surface references |
41 // (CL 2541683004) are ready. | 43 // (CL 2541683004) are ready. |
42 // Add the provided |sequence| as a destruction dependency of the | 44 // Add the provided |sequence| as a destruction dependency of the |
43 // surface associated with the provided |local_surface_id|. | 45 // surface associated with the provided |local_surface_id|. |
44 Require(cc.mojom.LocalSurfaceId local_surface_id, | 46 Require(cc.mojom.LocalSurfaceId local_surface_id, |
45 cc.mojom.SurfaceSequence sequence); | 47 cc.mojom.SurfaceSequence sequence); |
46 | 48 |
47 // Mark the sequence as satisfied and garbage collect surfaces. | 49 // Mark the sequence as satisfied and garbage collect surfaces. |
48 Satisfy(cc.mojom.SurfaceSequence sequence); | 50 Satisfy(cc.mojom.SurfaceSequence sequence); |
49 | |
50 // TODO(fsamuel): ReadbackBitmap API would be useful here. | |
51 }; | 51 }; |
52 | 52 |
53 interface MojoCompositorFrameSinkClient { | 53 interface MojoCompositorFrameSinkClient { |
54 // Notification that the previous CompositorFrame given to | 54 // Notification that the previous CompositorFrame given to |
55 // SubmitCompositorFrame() has been processed and that another frame | 55 // SubmitCompositorFrame() has been processed and that another frame |
56 // can be submitted. This provides backpressure from the display compositor | 56 // can be submitted. This provides backpressure from the display compositor |
57 // so that frames are submitted only at the rate it can handle them. | 57 // 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. | 58 // 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 | 59 // However, there's a fair amount of cleanup and refactoring necessary to get |
60 // rid of it. | 60 // rid of it. |
61 DidReceiveCompositorFrameAck(); | 61 DidReceiveCompositorFrameAck(); |
62 | 62 |
63 // Notification for the client to generate a CompositorFrame. | 63 // Notification for the client to generate a CompositorFrame. |
64 OnBeginFrame(BeginFrameArgs args); | 64 OnBeginFrame(BeginFrameArgs args); |
65 | 65 |
66 // Returns resources sent to SubmitCompositorFrame to be reused or freed. | 66 // Returns resources sent to SubmitCompositorFrame to be reused or freed. |
67 ReclaimResources(ReturnedResourceArray resources); | 67 ReclaimResources(ReturnedResourceArray resources); |
68 | 68 |
69 // Called when surface is being scheduled for a draw. | 69 // Called when surface is being scheduled for a draw. |
70 WillDrawSurface(); | 70 WillDrawSurface(); |
71 }; | 71 }; |
72 | 72 |
73 // MojoCompositorFrameSinkPrivate is used by the display compositor host to set | 73 // MojoCompositorFrameSinkPrivate is used by the display compositor host to set |
74 // up BeginFrameSource hierarchies. This API lives in SurfaceManager but is | 74 // up BeginFrameSource hierarchies. This API lives in SurfaceManager but is |
75 // called from here in order to ensure that hierarchy registration does not race | 75 // called from here in order to ensure that hierarchy registration does not race |
76 // CompositorFrameSink creation. | 76 // CompositorFrameSink creation. |
77 interface MojoCompositorFrameSinkPrivate { | 77 interface MojoCompositorFrameSinkPrivate { |
78 AddChildFrameSink(FrameSinkId child_frame_sink_id); | 78 AddChildFrameSink(FrameSinkId child_frame_sink_id); |
79 RemoveChildFrameSink(FrameSinkId child_frame_sink_id); | 79 RemoveChildFrameSink(FrameSinkId child_frame_sink_id); |
| 80 |
| 81 // Requests that the renderer send back a copy of the surface that this |
| 82 // CompositorFrameSink submits to. The result can be in form of a bitmap |
| 83 // or a texture. See cc::CopyOutputRequest and cc::CopyOutputResult. |
| 84 RequestCopyOfSurface(cc.mojom.CopyOutputRequest request) |
| 85 => (cc.mojom.CopyOutputResult result); |
80 }; | 86 }; |
OLD | NEW |