OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 mojo; | 5 module mojo; |
6 | 6 |
7 import "components/view_manager/public/interfaces/quads.mojom"; | 7 import "components/view_manager/public/interfaces/compositor_frame.mojom"; |
8 import "components/view_manager/public/interfaces/surface_id.mojom"; | |
9 import "ui/mojo/geometry/geometry.mojom"; | |
10 | |
11 enum ResourceFormat { | |
12 RGBA_8888, | |
13 RGBA_4444, | |
14 BGRA_8888, | |
15 ALPHA_8, | |
16 LUMINANCE_8, | |
17 RGB_565, | |
18 ETC1, | |
19 }; | |
20 | |
21 struct Mailbox { | |
22 array<int8, 64> name; | |
23 }; | |
24 | |
25 struct MailboxHolder { | |
26 Mailbox mailbox; | |
27 uint32 texture_target; | |
28 uint32 sync_point; | |
29 }; | |
30 | |
31 struct TransferableResource { | |
32 uint32 id; | |
33 ResourceFormat format; | |
34 uint32 filter; | |
35 Size size; | |
36 MailboxHolder mailbox_holder; | |
37 bool is_repeated; | |
38 bool is_software; | |
39 }; | |
40 | 8 |
41 struct ReturnedResource { | 9 struct ReturnedResource { |
42 uint32 id; | 10 uint32 id; |
43 uint32 sync_point; | 11 uint32 sync_point; |
44 int32 count; | 12 int32 count; |
45 bool lost; | 13 bool lost; |
46 }; | 14 }; |
47 | 15 |
48 struct Frame { | |
49 array<TransferableResource> resources; | |
50 array<Pass> passes; | |
51 }; | |
52 | |
53 interface ResourceReturner { | 16 interface ResourceReturner { |
54 ReturnResources(array<ReturnedResource> resources); | 17 ReturnResources(array<ReturnedResource> resources); |
55 }; | 18 }; |
56 | 19 |
57 interface Surface { | 20 interface Surface { |
58 // Request the id namespace for this connection. Fully qualified surface ids | 21 // Request the id namespace for this connection. Fully qualified surface ids |
59 // are the combination of the id_namespace for the connection that created the | 22 // are the combination of the id_namespace for the connection that created the |
60 // surface and the id_local component allocated by the caller. | 23 // surface and the id_local component allocated by the caller. |
61 GetIdNamespace() => (uint32 id_namespace); | 24 GetIdNamespace() => (uint32 id_namespace); |
62 | 25 |
63 // Sets a ResourceReturner that will receive unused resources. | 26 // Sets a ResourceReturner that will receive unused resources. |
64 SetResourceReturner(ResourceReturner returner); | 27 SetResourceReturner(ResourceReturner returner); |
65 | 28 |
66 // Creates a new surface with the given local identifier. Once a surface is | 29 // Creates a new surface with the given local identifier. Once a surface is |
67 // created the caller may submit frames to it or destroy it using the local | 30 // created the caller may submit frames to it or destroy it using the local |
68 // identifier. The caller can also produce a fully qualified surface id that | 31 // identifier. The caller can also produce a fully qualified surface id that |
69 // can be embedded in frames produces by different connections. | 32 // can be embedded in frames produces by different connections. |
70 CreateSurface(uint32 id_local); | 33 CreateSurface(uint32 id_local); |
71 | 34 |
72 // After the submitted frame is drawn for the first time, the surface will | 35 // After the submitted frame is drawn for the first time, the surface will |
73 // respond to the SubmitFrame message. Clients should use this acknowledgement | 36 // respond to the SubmitFrame message. Clients should use this acknowledgement |
74 // to ratelimit frame submissions. | 37 // to ratelimit frame submissions. |
75 SubmitFrame(uint32 id_local, Frame frame) => (); | 38 SubmitFrame(uint32 id_local, CompositorFrame frame) => (); |
76 DestroySurface(uint32 id_local); | 39 DestroySurface(uint32 id_local); |
77 }; | 40 }; |
OLD | NEW |