| 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/frame_sink_id.mojom"; | 9 import "cc/ipc/frame_sink_id.mojom"; |
| 10 import "cc/ipc/local_frame_id.mojom"; | 10 import "cc/ipc/local_frame_id.mojom"; |
| 11 import "cc/ipc/surface_reference.mojom"; | 11 import "cc/ipc/surface_reference.mojom"; |
| 12 import "cc/ipc/returned_resource.mojom"; | 12 import "cc/ipc/returned_resource.mojom"; |
| 13 import "cc/ipc/surface_sequence.mojom"; |
| 13 | 14 |
| 14 // A MojoCompositorFrameSink is an interface for receiving CompositorFrame | 15 // A MojoCompositorFrameSink is an interface for receiving CompositorFrame |
| 15 // structs. A CompositorFrame contains the complete output meant for display. | 16 // structs. A CompositorFrame contains the complete output meant for display. |
| 16 // Each time a client has a graphical update, and receives an OnBeginFrame, it | 17 // Each time a client has a graphical update, and receives an OnBeginFrame, it |
| 17 // is responsible for creating a CompositorFrame to update its portion of the | 18 // is responsible for creating a CompositorFrame to update its portion of the |
| 18 // screen. | 19 // screen. |
| 19 interface MojoCompositorFrameSink { | 20 interface MojoCompositorFrameSink { |
| 20 // Lets the display compositor know that the client wishes to receive the next | 21 // Lets the display compositor know that the client wishes to receive the next |
| 21 // BeginFrame event. | 22 // BeginFrame event. |
| 22 SetNeedsBeginFrame(bool needs_begin_frame); | 23 SetNeedsBeginFrame(bool needs_begin_frame); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 35 // Adds surface references. | 36 // Adds surface references. |
| 36 AddSurfaceReferences(array<SurfaceReference> references); | 37 AddSurfaceReferences(array<SurfaceReference> references); |
| 37 | 38 |
| 38 // Removes surface references. | 39 // Removes surface references. |
| 39 RemoveSurfaceReferences(array<SurfaceReference> references); | 40 RemoveSurfaceReferences(array<SurfaceReference> references); |
| 40 | 41 |
| 41 // Notify that the surface is no longer in use (and is okay to be evicted) so | 42 // Notify that the surface is no longer in use (and is okay to be evicted) so |
| 42 // that its resources gets returned in time. | 43 // that its resources gets returned in time. |
| 43 EvictFrame(); | 44 EvictFrame(); |
| 44 | 45 |
| 46 // TODO(staraz): Delete Require() and Satisfy() once surface references |
| 47 // (CL 2541683004) are ready. |
| 48 // Add the provided |sequence| as a destruction dependency of the |
| 49 // surface associated with the provided |local_frame_id|. |
| 50 Require(cc.mojom.LocalFrameId local_frame_id, |
| 51 cc.mojom.SurfaceSequence sequence); |
| 52 |
| 53 // Mark the sequence as satisfied and garbage collect surfaces. |
| 54 Satisfy(cc.mojom.SurfaceSequence sequence); |
| 55 |
| 45 // TODO(fsamuel): ReadbackBitmap API would be useful here. | 56 // TODO(fsamuel): ReadbackBitmap API would be useful here. |
| 46 }; | 57 }; |
| 47 | 58 |
| 48 interface MojoCompositorFrameSinkClient { | 59 interface MojoCompositorFrameSinkClient { |
| 49 // Notification that the previous CompositorFrame given to | 60 // Notification that the previous CompositorFrame given to |
| 50 // SubmitCompositorFrame() has been processed and that another frame | 61 // SubmitCompositorFrame() has been processed and that another frame |
| 51 // can be submitted. This provides backpressure from the display compositor | 62 // can be submitted. This provides backpressure from the display compositor |
| 52 // so that frames are submitted only at the rate it can handle them. | 63 // so that frames are submitted only at the rate it can handle them. |
| 53 // TODO(fsamuel): This method ought not be necessary with unified BeginFrame. | 64 // TODO(fsamuel): This method ought not be necessary with unified BeginFrame. |
| 54 // However, there's a fair amount of cleanup and refactoring necessary to get | 65 // However, there's a fair amount of cleanup and refactoring necessary to get |
| (...skipping 11 matching lines...) Expand all Loading... |
| 66 }; | 77 }; |
| 67 | 78 |
| 68 // MojoCompositorFrameSinkPrivate is used by the display compositor host to set | 79 // MojoCompositorFrameSinkPrivate is used by the display compositor host to set |
| 69 // up BeginFrameSource hierarchies. This API lives in SurfaceManager but is | 80 // up BeginFrameSource hierarchies. This API lives in SurfaceManager but is |
| 70 // called from here in order to ensure that hierarchy registration does not race | 81 // called from here in order to ensure that hierarchy registration does not race |
| 71 // CompositorFrameSink creation. | 82 // CompositorFrameSink creation. |
| 72 interface MojoCompositorFrameSinkPrivate { | 83 interface MojoCompositorFrameSinkPrivate { |
| 73 AddChildFrameSink(FrameSinkId child_frame_sink_id); | 84 AddChildFrameSink(FrameSinkId child_frame_sink_id); |
| 74 RemoveChildFrameSink(FrameSinkId child_frame_sink_id); | 85 RemoveChildFrameSink(FrameSinkId child_frame_sink_id); |
| 75 }; | 86 }; |
| OLD | NEW |