Linux: Depend on liberation-fonts package for RPMs.
[chromium-blink-merge.git] / components / mus / public / interfaces / command_buffer.mojom
blob1af78e5862da29a611b8a484888f086ce8c17000
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 import "components/mus/public/interfaces/gpu_capabilities.mojom";
8 import "ui/mojo/geometry/geometry.mojom";
10 struct CommandBufferState {
11   int32 num_entries;
12   int32 get_offset;
13   int32 put_offset;
14   int32 token;
15   int32 error;  // TODO(piman): enum
16   int32 context_lost_reason;  // TODO(piman): enum
17   uint32 generation;
20 interface CommandBufferSyncClient {
21   // |capabilities| is null if |success| is false.
22   DidInitialize(bool success, GpuCapabilities? capabilities);
23   DidMakeProgress(CommandBufferState state);
26 interface CommandBufferSyncPointClient {
27   DidInsertSyncPoint(uint32 sync_point);
30 interface CommandBufferLostContextObserver {
31   DidLoseContext(int32 context_lost_reason);
34 interface CommandBuffer {
35   // Initialize attempts to initialize the command buffer. Success or failure
36   // will be communicated via the CommandBufferSyncClient DidInitialize() call.
37   // If the context is lost after creation the LostContext method on the
38   // CommandBufferLostContextObserver's will be called then this pipe will be
39   // closed.
40   Initialize(CommandBufferSyncClient sync_client,
41              CommandBufferSyncPointClient sync_point_client,
42              CommandBufferLostContextObserver lost_observer,
43              handle<shared_buffer> shared_state,
44              array<int32> attribs);
45   SetGetBuffer(int32 buffer);
46   Flush(int32 put_offset);
47   MakeProgress(int32 last_get_offset);
48   RegisterTransferBuffer(
49       int32 id, handle<shared_buffer> transfer_buffer, uint32 size);
50   DestroyTransferBuffer(int32 id);
52   // InsertSyncPoint returns the sync point returned via DidInsertSyncPoint.
53   // If |retire| is true, the sync point is retired on insertion. Otherwise,
54   // explicitly call RetireSyncPoint to retire it.
55   InsertSyncPoint(bool retire);
56   RetireSyncPoint(uint32 sync_point);
57   Echo() => ();
59   CreateImage(int32 id,
60               handle memory_handle,
61               int32 type,
62               Size size,
63               int32 format,
64               int32 internal_format);
65   DestroyImage(int32 id);