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 "geometry/public/interfaces/geometry.mojom"; | 7 import "geometry/public/interfaces/geometry.mojom"; |
8 import "gpu/public/interfaces/command_buffer.mojom"; | 8 import "gpu/public/interfaces/command_buffer.mojom"; |
9 import "gpu/public/interfaces/viewport_parameter_listener.mojom"; | 9 import "gpu/public/interfaces/viewport_parameter_listener.mojom"; |
10 import "surfaces/public/interfaces/quads.mojom"; | 10 import "surfaces/public/interfaces/quads.mojom"; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 uint32 sync_point; | 45 uint32 sync_point; |
46 int32 count; | 46 int32 count; |
47 bool lost; | 47 bool lost; |
48 }; | 48 }; |
49 | 49 |
50 struct Frame { | 50 struct Frame { |
51 array<TransferableResource> resources; | 51 array<TransferableResource> resources; |
52 array<Pass> passes; | 52 array<Pass> passes; |
53 }; | 53 }; |
54 | 54 |
55 interface SurfaceClient { | 55 interface ResourceReturner { |
56 // This sets the id namespace for this connection. This method will be invoked | |
57 // exactly once when a new connection is established. | |
58 SetIdNamespace(uint32 id_namespace); | |
59 ReturnResources(array<ReturnedResource> resources); | 56 ReturnResources(array<ReturnedResource> resources); |
60 }; | 57 }; |
61 | 58 |
62 [Client=SurfaceClient] | |
63 interface Surface { | 59 interface Surface { |
| 60 // Request the id namespace for this connection. Fully qualified surface ids |
| 61 // are the combination of the id_namespace for the connection that created the |
| 62 // surface and the id_local component allocated by the caller. |
| 63 GetIdNamespace() => (uint32 id_namespace); |
| 64 |
| 65 // Sets a ResourceReturner that will receive unused resources. |
| 66 SetResourceReturner(ResourceReturner returner); |
| 67 |
| 68 // Creates a new surface with the given local identifier. Once a surface is |
| 69 // created the caller may submit frames to it or destroy it using the local |
| 70 // identifier. The caller can also produce a fully qualified surface id that |
| 71 // can be embedded in frames produces by different connections. |
64 CreateSurface(uint32 id_local); | 72 CreateSurface(uint32 id_local); |
65 | 73 |
66 // The client can only submit frames to surfaces created with this | 74 // After the submitted frame is drawn for the first time, the surface will |
67 // connection. After the submitted frame is drawn for the first time, the | 75 // respond to the SubmitFrame message. Clients should use this acknowledgement |
68 // surface will respond to the SubmitFrame message. Clients should use this | 76 // to ratelimit frame submissions. |
69 // acknowledgement to ratelimit frame submissions. | |
70 SubmitFrame(uint32 id_local, Frame frame) => (); | 77 SubmitFrame(uint32 id_local, Frame frame) => (); |
71 DestroySurface(uint32 id_local); | 78 DestroySurface(uint32 id_local); |
72 | 79 |
73 CreateGLES2BoundSurface(CommandBuffer gles2_client, | 80 CreateGLES2BoundSurface(CommandBuffer gles2_client, |
74 uint32 id_local, | 81 uint32 id_local, |
75 Size size, | 82 Size size, |
76 ViewportParameterListener& listener); | 83 ViewportParameterListener& listener); |
77 }; | 84 }; |
OLD | NEW |