OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 module mojo; | |
6 | |
7 import "components/surfaces/public/interfaces/quads.mojom"; | |
8 import "components/surfaces/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 | |
41 struct ReturnedResource { | |
42 uint32 id; | |
43 uint32 sync_point; | |
44 int32 count; | |
45 bool lost; | |
46 }; | |
47 | |
48 struct Frame { | |
49 array<TransferableResource> resources; | |
50 array<Pass> passes; | |
51 }; | |
52 | |
53 interface ResourceReturner { | |
54 ReturnResources(array<ReturnedResource> resources); | |
55 }; | |
56 | |
57 interface Surface { | |
58 // 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 | |
60 // surface and the id_local component allocated by the caller. | |
61 GetIdNamespace() => (uint32 id_namespace); | |
62 | |
63 // Sets a ResourceReturner that will receive unused resources. | |
64 SetResourceReturner(ResourceReturner returner); | |
65 | |
66 // 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 | |
68 // identifier. The caller can also produce a fully qualified surface id that | |
69 // can be embedded in frames produces by different connections. | |
70 CreateSurface(uint32 id_local); | |
71 | |
72 // After the submitted frame is drawn for the first time, the surface will | |
73 // respond to the SubmitFrame message. Clients should use this acknowledgement | |
74 // to ratelimit frame submissions. | |
75 SubmitFrame(uint32 id_local, Frame frame) => (); | |
76 DestroySurface(uint32 id_local); | |
77 }; | |
OLD | NEW |