| 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 "gpu/interfaces/gpu_capabilities.mojom"; | 7 import "gpu/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 interface CommandBufferLostContextObserver { | 28 interface CommandBufferLostContextObserver { |
| 29 DidLoseContext(int32 context_lost_reason); | 29 DidLoseContext(int32 context_lost_reason); |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 interface CommandBuffer { | 32 interface CommandBuffer { |
| 33 // Initialize attempts to initialize the command buffer. Success or failure | 33 // Initialize attempts to initialize the command buffer. Success or failure |
| 34 // will be communicated via the CommandBufferSyncClient DidInitialize() call. | 34 // will be communicated via the CommandBufferSyncClient DidInitialize() call. |
| 35 // If the context is lost after creation the LostContext method on the | 35 // If the context is lost after creation the LostContext method on the |
| 36 // CommandBufferLostContextObserver's will be called then this pipe will be | 36 // CommandBufferLostContextObserver's will be called then this pipe will be |
| 37 // closed. | 37 // closed. |
| 38 Initialize(CommandBufferSyncClient sync_client, | 38 Initialize(CommandBufferSyncClient sync_client, CommandBufferSyncPointClient s
ync_point_client, CommandBufferLostContextObserver lost_observer, handle<shared_
buffer> shared_state); |
| 39 CommandBufferSyncPointClient sync_point_client, | |
| 40 CommandBufferLostContextObserver lost_observer, | |
| 41 handle<shared_buffer> shared_state); | |
| 42 SetGetBuffer(int32 buffer); | 39 SetGetBuffer(int32 buffer); |
| 43 Flush(int32 put_offset); | 40 Flush(int32 put_offset); |
| 44 MakeProgress(int32 last_get_offset); | 41 MakeProgress(int32 last_get_offset); |
| 45 RegisterTransferBuffer( | 42 RegisterTransferBuffer(int32 id, handle<shared_buffer> transfer_buffer, uint32
size); |
| 46 int32 id, handle<shared_buffer> transfer_buffer, uint32 size); | |
| 47 DestroyTransferBuffer(int32 id); | 43 DestroyTransferBuffer(int32 id); |
| 48 | 44 |
| 49 // InsertSyncPoint returns the sync point returned via DidInsertSyncPoint. | 45 // InsertSyncPoint returns the sync point returned via DidInsertSyncPoint. |
| 50 // If |retire| is true, the sync point is retired on insertion. Otherwise, | 46 // If |retire| is true, the sync point is retired on insertion. Otherwise, |
| 51 // explicitly call RetireSyncPoint to retire it. | 47 // explicitly call RetireSyncPoint to retire it. |
| 52 InsertSyncPoint(bool retire); | 48 InsertSyncPoint(bool retire); |
| 53 RetireSyncPoint(uint32 sync_point); | 49 RetireSyncPoint(uint32 sync_point); |
| 54 Echo() => (); | 50 Echo() => (); |
| 55 }; | 51 }; |
| OLD | NEW |