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.
7 import "components/view_manager/public/interfaces/quads.mojom";
8 import "components/view_manager/public/interfaces/surface_id.mojom";
9 import "ui/mojo/geometry/geometry.mojom";
25 struct MailboxHolder {
27 uint32 texture_target;
31 struct TransferableResource {
33 ResourceFormat format;
36 MailboxHolder mailbox_holder;
41 struct ReturnedResource {
49 array<TransferableResource> resources;
53 interface ResourceReturner {
54 ReturnResources(array<ReturnedResource> resources);
58 // Request the id namespace for this connection. Fully qualified surface ids
59 // are the combination of the id_namespace for the connection that created the
60 // surface and the id_local component allocated by the caller.
61 GetIdNamespace() => (uint32 id_namespace);
63 // Sets a ResourceReturner that will receive unused resources.
64 SetResourceReturner(ResourceReturner returner);
66 // Creates a new surface with the given local identifier. Once a surface is
67 // created the caller may submit frames to it or destroy it using the local
68 // identifier. The caller can also produce a fully qualified surface id that
69 // can be embedded in frames produces by different connections.
70 CreateSurface(uint32 id_local);
72 // After the submitted frame is drawn for the first time, the surface will
73 // respond to the SubmitFrame message. Clients should use this acknowledgement
74 // to ratelimit frame submissions.
75 SubmitFrame(uint32 id_local, Frame frame) => ();
76 DestroySurface(uint32 id_local);