• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
5import "mojo/services/gles2/command_buffer.mojom"
6import "mojo/services/public/interfaces/geometry/geometry.mojom"
7import "mojo/services/public/interfaces/surfaces/quads.mojom"
8import "mojo/services/public/interfaces/surfaces/surface_id.mojom"
9
10module mojo {
11
12enum ResourceFormat {
13  RGBA_8888,
14  RGBA_4444,
15  BGRA_8888,
16  ALPHA_8,
17  LUMINANCE_8,
18  RGB_565,
19  ETC1,
20};
21
22struct Mailbox {
23  int8[64] name;
24};
25
26struct MailboxHolder {
27  Mailbox mailbox;
28  uint32 texture_target;
29  uint32 sync_point;
30};
31
32struct 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;
40};
41
42struct ReturnedResource {
43  uint32 id;
44  uint32 sync_point;
45  int32 count;
46  bool lost;
47};
48
49struct Frame {
50  TransferableResource[] resources;
51  Pass[] passes;
52};
53
54interface SurfaceClient {
55  ReturnResources(ReturnedResource[] resources);
56};
57
58[Client=SurfaceClient]
59interface 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);
63
64  // The client can only submit frames to surfaces created with this connection.
65  SubmitFrame(SurfaceId id, Frame frame);
66  DestroySurface(SurfaceId id);
67
68  CreateGLES2BoundSurface(CommandBuffer gles2_client,
69                          SurfaceId id,
70                          Size size);
71};
72
73}
74