| 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/compositor_frame.mojom"; | 8 import "cc/ipc/compositor_frame.mojom"; |
| 9 import "cc/ipc/frame_sink_id.mojom"; |
| 8 import "cc/ipc/returned_resource.mojom"; | 10 import "cc/ipc/returned_resource.mojom"; |
| 9 | 11 |
| 10 // A MojoCompositorFrameSink is an interface for receiving CompositorFrame | 12 // A MojoCompositorFrameSink is an interface for receiving CompositorFrame |
| 11 // structs. A CompositorFrame contains the complete output meant for display. | 13 // structs. A CompositorFrame contains the complete output meant for display. |
| 12 // Each time a client has a graphical update, and receives an OnBeginFrame, it | 14 // Each time a client has a graphical update, and receives an OnBeginFrame, it |
| 13 // is responsible for creating a CompositorFrame to update its portion of the | 15 // is responsible for creating a CompositorFrame to update its portion of the |
| 14 // screen. | 16 // screen. |
| 15 interface MojoCompositorFrameSink { | 17 interface MojoCompositorFrameSink { |
| 16 // Lets the display compositor know that the client wishes to receive the next | 18 // Lets the display compositor know that the client wishes to receive the next |
| 17 // BeginFrame event. | 19 // BeginFrame event. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 31 interface MojoCompositorFrameSinkClient { | 33 interface MojoCompositorFrameSinkClient { |
| 32 // Notification that the previous CompositorFrame given to | 34 // Notification that the previous CompositorFrame given to |
| 33 // SubmitCompositorFrame() has been processed and that another frame | 35 // SubmitCompositorFrame() has been processed and that another frame |
| 34 // can be submitted. This provides backpressure from the display compositor | 36 // can be submitted. This provides backpressure from the display compositor |
| 35 // so that frames are submitted only at the rate it can handle them. | 37 // so that frames are submitted only at the rate it can handle them. |
| 36 // TODO(fsamuel): This method ought not be necessary with unified BeginFrame. | 38 // TODO(fsamuel): This method ought not be necessary with unified BeginFrame. |
| 37 // However, there's a fair amount of cleanup and refactoring necessary to get | 39 // However, there's a fair amount of cleanup and refactoring necessary to get |
| 38 // rid of it. | 40 // rid of it. |
| 39 DidReceiveCompositorFrameAck(); | 41 DidReceiveCompositorFrameAck(); |
| 40 | 42 |
| 43 // Notification for the client to generate a CompositorFrame. |
| 44 OnBeginFrame(BeginFrameArgs args); |
| 45 |
| 41 // Returns resources sent to SubmitCompositorFrame to be reused or freed. | 46 // Returns resources sent to SubmitCompositorFrame to be reused or freed. |
| 42 ReclaimResources(ReturnedResourceArray resources); | 47 ReclaimResources(ReturnedResourceArray resources); |
| 43 }; | 48 }; |
| 49 |
| 50 // MojoCompositorFrameSinkPrivate is used by the display compositor host to set |
| 51 // up BeginFrameSource hierarchies. This API lives in SurfaceManager but is |
| 52 // called from here in order to ensure that hierarchy registration does not race |
| 53 // CompositorFrameSink creation. |
| 54 interface MojoCompositorFrameSinkPrivate { |
| 55 AddChildFrameSink(FrameSinkId child_frame_sink_id); |
| 56 RemoveChildFrameSink(FrameSinkId child_frame_sink_id); |
| 57 }; |
| OLD | NEW |