Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: cc/ipc/mojo_compositor_frame_sink.mojom

Issue 2493223002: Change exo::SurfaceFactoryOwner to exo::ExoCompositorFrameSink (Closed)
Patch Set: Added MojoCompositorFrameSink::Require() and MojoCompositorFrameSink::Satisfy() Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/returned_resource.mojom"; 11 import "cc/ipc/returned_resource.mojom";
12 import "cc/ipc/surface_sequence.mojom";
12 13
13 // A MojoCompositorFrameSink is an interface for receiving CompositorFrame 14 // A MojoCompositorFrameSink is an interface for receiving CompositorFrame
14 // structs. A CompositorFrame contains the complete output meant for display. 15 // structs. A CompositorFrame contains the complete output meant for display.
15 // Each time a client has a graphical update, and receives an OnBeginFrame, it 16 // Each time a client has a graphical update, and receives an OnBeginFrame, it
16 // is responsible for creating a CompositorFrame to update its portion of the 17 // is responsible for creating a CompositorFrame to update its portion of the
17 // screen. 18 // screen.
18 interface MojoCompositorFrameSink { 19 interface MojoCompositorFrameSink {
19 // Lets the display compositor know that the client wishes to receive the next 20 // Lets the display compositor know that the client wishes to receive the next
20 // BeginFrame event. 21 // BeginFrame event.
21 SetNeedsBeginFrame(bool needs_begin_frame); 22 SetNeedsBeginFrame(bool needs_begin_frame);
22 23
23 // Submits a CompositorFrame to the display compositor that will be presented 24 // Submits a CompositorFrame to the display compositor that will be presented
24 // to screen the next time frames from all CompositorFrameSinks are aggregated 25 // to screen the next time frames from all CompositorFrameSinks are aggregated
25 // to produce a display CompositorFrame. If a client wishes to allocate a new 26 // to produce a display CompositorFrame. If a client wishes to allocate a new
26 // surface (e.g. during resize), then it can simply allocate a new 27 // surface (e.g. during resize), then it can simply allocate a new
27 // |local_frame_id|. 28 // |local_frame_id|.
28 // For successful swaps, the implementation must call 29 // For successful swaps, the implementation must call
29 // DidReceiveCompositorFrameAck() asynchronously when the frame has been 30 // DidReceiveCompositorFrameAck() asynchronously when the frame has been
30 // processed in order to unthrottle the next frame. 31 // processed in order to unthrottle the next frame.
31 SubmitCompositorFrame(cc.mojom.LocalFrameId local_frame_id, 32 SubmitCompositorFrame(cc.mojom.LocalFrameId local_frame_id,
32 cc.mojom.CompositorFrame frame); 33 cc.mojom.CompositorFrame frame);
33 34
34 // Notify that the surface is no longer in use (and is okay to be evicted) so 35 // Notify that the surface is no longer in use (and is okay to be evicted) so
35 // that its resources gets returned in time. 36 // that its resources gets returned in time.
36 EvictFrame(); 37 EvictFrame();
37 38
39 // Add the surface associated with the id to the destruction dependency of the
40 // sequence.
Fady Samuel 2016/12/05 16:40:31 How about: "Add the provided |sequence| as a destr
Alex Z. 2016/12/06 20:10:41 Done. The change has also been made to the separat
41 Require(cc.mojom.LocalFrameId local_frame_id,
42 cc.mojom.SurfaceSequence sequence);
43
44 // Mark the sequence as satisfied and garbage collect surfaces.
45 Satisfy(cc.mojom.SurfaceSequence sequence);
46
38 // TODO(fsamuel): ReadbackBitmap API would be useful here. 47 // TODO(fsamuel): ReadbackBitmap API would be useful here.
39 }; 48 };
40 49
41 interface MojoCompositorFrameSinkClient { 50 interface MojoCompositorFrameSinkClient {
42 // Notification that the previous CompositorFrame given to 51 // Notification that the previous CompositorFrame given to
43 // SubmitCompositorFrame() has been processed and that another frame 52 // SubmitCompositorFrame() has been processed and that another frame
44 // can be submitted. This provides backpressure from the display compositor 53 // can be submitted. This provides backpressure from the display compositor
45 // so that frames are submitted only at the rate it can handle them. 54 // so that frames are submitted only at the rate it can handle them.
46 // TODO(fsamuel): This method ought not be necessary with unified BeginFrame. 55 // TODO(fsamuel): This method ought not be necessary with unified BeginFrame.
47 // However, there's a fair amount of cleanup and refactoring necessary to get 56 // However, there's a fair amount of cleanup and refactoring necessary to get
(...skipping 11 matching lines...) Expand all
59 }; 68 };
60 69
61 // MojoCompositorFrameSinkPrivate is used by the display compositor host to set 70 // MojoCompositorFrameSinkPrivate is used by the display compositor host to set
62 // up BeginFrameSource hierarchies. This API lives in SurfaceManager but is 71 // up BeginFrameSource hierarchies. This API lives in SurfaceManager but is
63 // called from here in order to ensure that hierarchy registration does not race 72 // called from here in order to ensure that hierarchy registration does not race
64 // CompositorFrameSink creation. 73 // CompositorFrameSink creation.
65 interface MojoCompositorFrameSinkPrivate { 74 interface MojoCompositorFrameSinkPrivate {
66 AddChildFrameSink(FrameSinkId child_frame_sink_id); 75 AddChildFrameSink(FrameSinkId child_frame_sink_id);
67 RemoveChildFrameSink(FrameSinkId child_frame_sink_id); 76 RemoveChildFrameSink(FrameSinkId child_frame_sink_id);
68 }; 77 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698