Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / mojo / services / gles2 / command_buffer.mojom
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 struct CommandBufferState {
8   int32 num_entries;
9   int32 get_offset;
10   int32 put_offset;
11   int32 token;
12   int32 error;  // TODO(piman): enum
13   int32 context_lost_reason;  // TODO(piman): enum
14   uint32 generation;
15 };
16
17 // TODO(piman): we need to support proper SHM handles, or refactor command
18 // buffers to sit on top of mojo primitives (e.g. DataPipe, etc.).
19 struct ShmHandle {
20   uint64 handle_hack;
21 };
22
23 interface CommandBufferSyncClient {
24   void DidInitialize(bool success);
25   void DidMakeProgress(CommandBufferState state);
26 };
27
28 [Peer=CommandBufferClient]
29 interface CommandBuffer {
30   void Initialize(CommandBufferSyncClient sync_client,
31                   ShmHandle shared_state);
32   void SetGetBuffer(int32 buffer);
33   void Flush(int32 put_offset);
34   void MakeProgress(int32 last_get_offset);
35   void RegisterTransferBuffer(int32 id, ShmHandle transfer_buffer, uint32 size);
36   void DestroyTransferBuffer(int32 id);
37   void Echo();
38
39   // TODO(piman): move to somewhere else (native_viewport?).
40   void RequestAnimationFrames();
41   void CancelAnimationFrames();
42
43   // TODO(piman): sync points
44 };
45
46 [Peer=CommandBuffer]
47 interface CommandBufferClient {
48   void DidDestroy();
49   void EchoAck();
50   void LostContext(int32 lost_reason);  // TODO(piman): enum
51
52   // TODO(piman): move to somewhere else (native_viewport?).
53   void DrawAnimationFrame();
54 };
55
56 }
57