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 "mojo/services/public/interfaces/geometry/geometry.mojom"; | |
8 import "mojo/services/public/interfaces/gpu/command_buffer.mojom"; | |
9 import "mojo/services/public/interfaces/gpu/viewport_parameter_listener.mojom"; | |
10 import "mojo/services/public/interfaces/surfaces/quads.mojom"; | |
11 import "mojo/services/public/interfaces/surfaces/surface_id.mojom"; | |
12 | |
13 enum ResourceFormat { | |
14 RGBA_8888, | |
15 RGBA_4444, | |
16 BGRA_8888, | |
17 ALPHA_8, | |
18 LUMINANCE_8, | |
19 RGB_565, | |
20 ETC1, | |
21 }; | |
22 | |
23 struct Mailbox { | |
24 array<int8, 64> name; | |
25 }; | |
26 | |
27 struct MailboxHolder { | |
28 Mailbox mailbox; | |
29 uint32 texture_target; | |
30 uint32 sync_point; | |
31 }; | |
32 | |
33 struct TransferableResource { | |
34 uint32 id; | |
35 ResourceFormat format; | |
36 uint32 filter; | |
37 Size size; | |
38 MailboxHolder mailbox_holder; | |
39 bool is_repeated; | |
40 bool is_software; | |
41 }; | |
42 | |
43 struct ReturnedResource { | |
44 uint32 id; | |
45 uint32 sync_point; | |
46 int32 count; | |
47 bool lost; | |
48 }; | |
49 | |
50 struct Frame { | |
51 array<TransferableResource> resources; | |
52 array<Pass> passes; | |
53 }; | |
54 | |
55 interface SurfaceClient { | |
56 ReturnResources(array<ReturnedResource> resources); | |
57 }; | |
58 | |
59 [Client=SurfaceClient] | |
60 interface Surface { | |
61 // The id is created by the client and must be unique and contain the | |
62 // connection's namespace in the upper 32 bits. | |
63 CreateSurface(SurfaceId id, Size size); | |
64 | |
65 // The client can only submit frames to surfaces created with this | |
66 // connection. After the submitted frame is drawn for the first time, the | |
67 // surface will respond to the SubmitFrame message. Clients should use this | |
68 // acknowledgement to ratelimit frame submissions. | |
69 SubmitFrame(SurfaceId id, Frame frame) => (); | |
70 DestroySurface(SurfaceId id); | |
71 | |
72 CreateGLES2BoundSurface(CommandBuffer gles2_client, | |
73 SurfaceId id, | |
74 Size size, | |
75 ViewportParameterListener& listener); | |
76 }; | |
OLD | NEW |