Revert of Revert of Revert of Introduce SessionManager that will contain code to...
[chromium-blink-merge.git] / mojo / services / gles2 / command_buffer.mojom
blob1f91362eb4d37203580a01c04114bfe733eda84d
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 module mojo {
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;
17 interface CommandBufferSyncClient {
18   DidInitialize(bool success);
19   DidMakeProgress(CommandBufferState state);
22 [Client=CommandBufferClient]
23 interface CommandBuffer {
24   Initialize(CommandBufferSyncClient sync_client,
25              handle<shared_buffer> shared_state);
26   SetGetBuffer(int32 buffer);
27   Flush(int32 put_offset);
28   MakeProgress(int32 last_get_offset);
29   RegisterTransferBuffer(
30       int32 id, handle<shared_buffer> transfer_buffer, uint32 size);
31   DestroyTransferBuffer(int32 id);
32   Echo() => ();
34   // TODO(piman): move to somewhere else (native_viewport?).
35   RequestAnimationFrames();
36   CancelAnimationFrames();
38   // TODO(piman): sync points
41 interface CommandBufferClient {
42   DidDestroy();
43   LostContext(int32 lost_reason);  // TODO(piman): enum
45   // TODO(piman): move to somewhere else (native_viewport?).
46   DrawAnimationFrame();