| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 [DartPackage="mojo_services"] | |
| 6 module mojo; | |
| 7 | |
| 8 import "geometry/interfaces/geometry.mojom"; | |
| 9 import "surfaces/public/interfaces/quads.mojom"; | |
| 10 import "surfaces/public/interfaces/surface_id.mojom"; | |
| 11 | |
| 12 enum ResourceFormat { | |
| 13 RGBA_8888, | |
| 14 RGBA_4444, | |
| 15 BGRA_8888, | |
| 16 ALPHA_8, | |
| 17 LUMINANCE_8, | |
| 18 RGB_565, | |
| 19 ETC1, | |
| 20 }; | |
| 21 | |
| 22 struct Mailbox { | |
| 23 array<int8, 64> name; | |
| 24 }; | |
| 25 | |
| 26 struct MailboxHolder { | |
| 27 Mailbox mailbox; | |
| 28 uint32 texture_target; | |
| 29 uint32 sync_point; | |
| 30 }; | |
| 31 | |
| 32 struct TransferableResource { | |
| 33 uint32 id; | |
| 34 ResourceFormat format; | |
| 35 uint32 filter; | |
| 36 Size size; | |
| 37 MailboxHolder mailbox_holder; | |
| 38 bool is_repeated; | |
| 39 bool is_software; | |
| 40 }; | |
| 41 | |
| 42 struct ReturnedResource { | |
| 43 uint32 id; | |
| 44 uint32 sync_point; | |
| 45 int32 count; | |
| 46 bool lost; | |
| 47 }; | |
| 48 | |
| 49 struct Frame { | |
| 50 array<TransferableResource> resources; | |
| 51 array<Pass> passes; | |
| 52 }; | |
| 53 | |
| 54 interface ResourceReturner { | |
| 55 ReturnResources(array<ReturnedResource> resources); | |
| 56 }; | |
| 57 | |
| 58 interface Surface { | |
| 59 // Request the id namespace for this connection. Fully qualified surface ids | |
| 60 // are the combination of the id_namespace for the connection that created the | |
| 61 // surface and the id_local component allocated by the caller. | |
| 62 GetIdNamespace() => (uint32 id_namespace); | |
| 63 | |
| 64 // Sets a ResourceReturner that will receive unused resources. | |
| 65 SetResourceReturner(ResourceReturner returner); | |
| 66 | |
| 67 // Creates a new surface with the given local identifier. Once a surface is | |
| 68 // created the caller may submit frames to it or destroy it using the local | |
| 69 // identifier. The caller can also produce a fully qualified surface id that | |
| 70 // can be embedded in frames produces by different connections. | |
| 71 CreateSurface(uint32 id_local); | |
| 72 | |
| 73 // After the submitted frame is drawn for the first time, the surface will | |
| 74 // respond to the SubmitFrame message. Clients should use this acknowledgement | |
| 75 // to ratelimit frame submissions. | |
| 76 SubmitFrame(uint32 id_local, Frame frame) => (); | |
| 77 DestroySurface(uint32 id_local); | |
| 78 }; | |
| OLD | NEW |