OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 module mus.mojom; | |
6 | |
7 import "components/mus/public/interfaces/compositor_frame.mojom"; | |
8 | |
9 // Indicates whether the submitted CompositorFrame has been drawn to the display | |
10 // or has been skipped (e.g. another frame may have been submitted before | |
11 // vblank). | |
12 enum CompositorFrameDrawStatus { | |
13 DRAW_SKIPPED, | |
14 DRAWN | |
15 }; | |
16 | |
17 // A CompositorFrameSinkFactory represents a single Display client. | |
rjkroege
2016/05/19 22:08:37
I thought you were renaming the CFSF to DisplayCom
Fady Samuel
2016/05/25 12:37:00
I needed to separate privileged API and unprivileg
rjkroege
2016/05/25 19:14:19
please indicate very precisely which interfaces ar
| |
18 // The client (a process) can use this interface to create | |
19 // CompositorFrameSinks. | |
20 // TODO(fsamuel): This needs a better name. | |
21 interface CompositorFrameSinkFactory { | |
22 CreateCompositorFrameSink(int32 id, | |
rjkroege
2016/05/19 22:08:37
document the arguments.
Fady Samuel
2016/05/25 12:37:01
Done.
| |
23 CompositorFrameSink& sink, | |
24 CompositorFrameSinkClient client); | |
25 }; | |
26 | |
27 // A CompositorFrameSink is an interface for receiving CompositorFrame structs. | |
28 // A CompositorFrame contains the complete output meant for display. | |
rjkroege
2016/05/19 22:08:37
Please say how a CFS is going to be used? Remember
Fady Samuel
2016/05/25 12:37:00
Done.
| |
29 interface CompositorFrameSink { | |
30 // After the submitted frame is drawn for the first time, the receiver will | |
31 // respond to the SubmitFrame message. Clients should use this acknowledgement | |
32 // to ratelimit frame submissions. | |
33 SubmitCompositorFrame(CompositorFrame frame) => | |
rjkroege
2016/05/19 22:08:37
How does the client provide its async callback to
Fady Samuel
2016/05/25 12:37:00
I don't think that makes sense. This callback will
rjkroege
2016/05/25 19:14:19
OK
| |
34 (CompositorFrameDrawStatus status); | |
35 | |
36 // Lets the display know that the client wishes to receive the next | |
rjkroege
2016/05/19 22:08:37
Display is ambiguous. Indicate what kind of displa
Fady Samuel
2016/05/25 12:37:00
Done.
| |
37 // BeginFrame event. | |
38 SetNeedsBeginFrame(bool needs_begin_frame); | |
Fady Samuel
2016/05/19 15:17:42
ReadbackBitmap API makes sense here.
rjkroege
2016/05/19 22:08:37
add a TODO for it?
Fady Samuel
2016/05/25 12:37:00
Done.
| |
39 }; | |
40 | |
41 interface CompositorFrameSinkClient { | |
42 ReturnResources(array<ReturnedResource> resources); | |
43 }; | |
44 | |
45 // This is a public interface implemented by Display clients. | |
rjkroege
2016/05/19 22:08:37
Only the window server will ever be a DisplayClien
Fady Samuel
2016/05/25 12:37:00
That is not the case. All things that talk to the
| |
46 interface DisplayClient { | |
47 // The Mus Window Server is a root client, and so it will receive this | |
48 // callback. There can only be one root CompositorFrameSink per Display and so | |
49 // it does not get a CompositorFrameSinkFactory. | |
50 OnRootClientCreated(CompositorFrameSink sink, | |
51 CompositorFrameSinkClient& client); | |
52 | |
53 // Non-root clients will receive this callback. Clients can create | |
54 // CompositorFrameSinks via the provided |factory|. | |
55 OnClientCreated(int32 client_id, CompositorFrameSinkFactory factory); | |
56 | |
57 // TODO(fsamuel): Add BeginFrameArgs. | |
rjkroege
2016/05/19 22:08:37
what did you have in mind?
Fady Samuel
2016/05/25 12:37:00
See cc/output/begin_frame_args.h. I added a commen
| |
58 OnBeginFrame(); | |
59 }; | |
60 | |
61 // This is a privileged API to be used only by the Mus Window Server. | |
62 // There is one Display per physical display on Chrome OS, | |
rjkroege
2016/05/19 22:08:37
is there an 1-1 correspondence between Display, Pl
Fady Samuel
2016/05/25 12:37:00
Done.
| |
63 // and per window on other Chrome platforms. | |
64 interface Display { | |
65 // Each client (process) has a unique |client_id| and implements the | |
66 // DisplayClient interface. | |
67 CreateClient(int32 client_id, DisplayClient& client); | |
Fady Samuel
2016/05/19 03:16:34
The more I think about this, the more I think the
Fady Samuel
2016/05/25 12:37:00
Now that the security issue has been resolved here
| |
68 | |
69 // Tells the Display that the DisplayClient |parent_id| can embed any | |
70 // CompositorFrameSink created by DisplayClient |client_id| or its | |
71 // descendants. | |
72 AddClient(int32 parent_id, int32 client_id); | |
73 | |
74 // Tells the Display that the DisplayClient |parent_id| can no longer embed | |
75 // DisplayClient |child_id| or its descendants, unless they're explicitly | |
76 // allowed. | |
77 RemoveClient(int32 parent_id, int32 child_id); | |
78 }; | |
79 | |
80 // This is a privileged API to be used only by the Mus Window Server. | |
81 // There should be only one DisplayCompositor connection. | |
82 interface DisplayCompositor { | |
83 CreateDisplay(int32 accelerated_widget, | |
84 Display& display, | |
85 DisplayClient client); | |
86 }; | |
OLD | NEW |