Update mojo surfaces bindings and mojo/cc/ glue
[chromium-blink-merge.git] / mojo / services / public / interfaces / surfaces / surfaces.mojom
blob8299cb36eca22b6f39f93add9792f89e5e211ad6
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.
5 import "mojo/services/public/interfaces/geometry/geometry.mojom"
6 import "mojo/services/gles2/command_buffer.mojom"
7 import "mojo/services/public/interfaces/surfaces/quads.mojom"
8 import "mojo/services/public/interfaces/surfaces/surface_id.mojom"
10 module mojo {
12 enum ResourceFormat {
13   RGBA_8888,
14   RGBA_4444,
15   BGRA_8888,
16   ALPHA_8,
17   LUMINANCE_8,
18   RGB_565,
19   ETC1,
22 struct Mailbox {
23   int8[64] name;
26 struct MailboxHolder {
27   Mailbox mailbox;
28   uint32 texture_target;
29   uint32 sync_point;
32 struct TransferableResource {
33   uint32 id;
34   ResourceFormat format;
35   uint32 filter;
36   Size size;
37   MailboxHolder mailbox_holder;
38   bool is_repeated;
39   bool is_software;
42 struct ReturnedResource {
43   uint32 id;
44   uint32 sync_point;
45   int32 count;
46   bool lost;
49 struct Frame {
50   TransferableResource[] resources;
51   Pass[] passes;
54 interface SurfaceClient {
55   ReturnResources(ReturnedResource[] resources);
58 [Client=SurfaceClient]
59 interface Surface {
60   // The id is created by the client and must be unique and contain the
61   // connection's namespace in the upper 32 bits.
62   CreateSurface(SurfaceId id, Size size);
64   // The client can only submit frames to surfaces created with this connection.
65   SubmitFrame(SurfaceId id, Frame frame);
66   DestroySurface(SurfaceId id);
68   CreateGLES2BoundSurface(CommandBuffer gles2_client,
69                           SurfaceId id,
70                           Size size);