| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module mojo; | 5 module mojo; |
| 6 | 6 |
| 7 import "mojo/services/gpu/public/interfaces/gpu_capabilities.mojom"; | 7 import "mojo/services/gpu/public/interfaces/gpu_capabilities.mojom"; |
| 8 | 8 |
| 9 struct CommandBufferState { | 9 struct CommandBufferState { |
| 10 int32 num_entries; | 10 int32 num_entries; |
| 11 int32 get_offset; | 11 int32 get_offset; |
| 12 int32 put_offset; | 12 int32 put_offset; |
| 13 int32 token; | 13 int32 token; |
| 14 int32 error; // TODO(piman): enum | 14 int32 error; // TODO(piman): enum |
| 15 int32 context_lost_reason; // TODO(piman): enum | 15 int32 context_lost_reason; // TODO(piman): enum |
| 16 uint32 generation; | 16 uint32 generation; |
| 17 }; | 17 }; |
| 18 | 18 |
| 19 interface CommandBufferSyncClient { | 19 interface CommandBufferSyncClient { |
| 20 DidInitialize(bool success, GpuCapabilities capabilities); | 20 DidInitialize(bool success, GpuCapabilities capabilities); |
| 21 DidMakeProgress(CommandBufferState? state); | 21 DidMakeProgress(CommandBufferState state); |
| 22 }; | 22 }; |
| 23 | 23 |
| 24 interface CommandBufferSyncPointClient { | 24 interface CommandBufferSyncPointClient { |
| 25 DidInsertSyncPoint(uint32 sync_point); | 25 DidInsertSyncPoint(uint32 sync_point); |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 [Client=CommandBufferClient] | 28 [Client=CommandBufferClient] |
| 29 interface CommandBuffer { | 29 interface CommandBuffer { |
| 30 Initialize(CommandBufferSyncClient? sync_client, | 30 Initialize(CommandBufferSyncClient sync_client, |
| 31 CommandBufferSyncPointClient? sync_point_client, | 31 CommandBufferSyncPointClient sync_point_client, |
| 32 handle<shared_buffer>? shared_state); | 32 handle<shared_buffer> shared_state); |
| 33 SetGetBuffer(int32 buffer); | 33 SetGetBuffer(int32 buffer); |
| 34 Flush(int32 put_offset); | 34 Flush(int32 put_offset); |
| 35 MakeProgress(int32 last_get_offset); | 35 MakeProgress(int32 last_get_offset); |
| 36 RegisterTransferBuffer( | 36 RegisterTransferBuffer( |
| 37 int32 id, handle<shared_buffer>? transfer_buffer, uint32 size); | 37 int32 id, handle<shared_buffer> transfer_buffer, uint32 size); |
| 38 DestroyTransferBuffer(int32 id); | 38 DestroyTransferBuffer(int32 id); |
| 39 | 39 |
| 40 // InsertSyncPoint returns the sync point returned via DidInsertSyncPoint. | 40 // InsertSyncPoint returns the sync point returned via DidInsertSyncPoint. |
| 41 // If |retire| is true, the sync point is retired on insertion. Otherwise, | 41 // If |retire| is true, the sync point is retired on insertion. Otherwise, |
| 42 // explicitly call RetireSyncPoint to retire it. | 42 // explicitly call RetireSyncPoint to retire it. |
| 43 InsertSyncPoint(bool retire); | 43 InsertSyncPoint(bool retire); |
| 44 RetireSyncPoint(uint32 sync_point); | 44 RetireSyncPoint(uint32 sync_point); |
| 45 Echo() => (); | 45 Echo() => (); |
| 46 | 46 |
| 47 // TODO(piman): sync points | 47 // TODO(piman): sync points |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 interface CommandBufferClient { | 50 interface CommandBufferClient { |
| 51 DidDestroy(); | 51 DidDestroy(); |
| 52 LostContext(int32 lost_reason); // TODO(piman): enum | 52 LostContext(int32 lost_reason); // TODO(piman): enum |
| 53 }; | 53 }; |
| OLD | NEW |