| 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 ResourceReturner { | 55 interface SurfaceClient { |
| 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); |
| 56 ReturnResources(array<ReturnedResource> resources); | 59 ReturnResources(array<ReturnedResource> resources); |
| 57 }; | 60 }; |
| 58 | 61 |
| 62 [Client=SurfaceClient] |
| 59 interface Surface { | 63 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. | |
| 72 CreateSurface(uint32 id_local); | 64 CreateSurface(uint32 id_local); |
| 73 | 65 |
| 74 // After the submitted frame is drawn for the first time, the surface will | 66 // The client can only submit frames to surfaces created with this |
| 75 // respond to the SubmitFrame message. Clients should use this acknowledgement | 67 // connection. After the submitted frame is drawn for the first time, the |
| 76 // to ratelimit frame submissions. | 68 // surface will respond to the SubmitFrame message. Clients should use this |
| 69 // acknowledgement to ratelimit frame submissions. |
| 77 SubmitFrame(uint32 id_local, Frame frame) => (); | 70 SubmitFrame(uint32 id_local, Frame frame) => (); |
| 78 DestroySurface(uint32 id_local); | 71 DestroySurface(uint32 id_local); |
| 79 | 72 |
| 80 CreateGLES2BoundSurface(CommandBuffer gles2_client, | 73 CreateGLES2BoundSurface(CommandBuffer gles2_client, |
| 81 uint32 id_local, | 74 uint32 id_local, |
| 82 Size size, | 75 Size size, |
| 83 ViewportParameterListener& listener); | 76 ViewportParameterListener& listener); |
| 84 }; | 77 }; |
| OLD | NEW |