| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 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 module mojo; | |
| 6 | |
| 7 import "ui/mojo/geometry/geometry.mojom"; | |
| 8 import "components/view_manager/public/interfaces/quads.mojom"; | |
| 9 | |
| 10 enum ResourceFormat { | |
| 11 RGBA_8888, | |
| 12 RGBA_4444, | |
| 13 BGRA_8888, | |
| 14 ALPHA_8, | |
| 15 LUMINANCE_8, | |
| 16 RGB_565, | |
| 17 ETC1, | |
| 18 }; | |
| 19 | |
| 20 // See src/cc/resources/returned_resource.h. | |
| 21 struct ReturnedResource { | |
| 22 uint32 id; | |
| 23 uint32 sync_point; | |
| 24 int32 count; | |
| 25 bool lost; | |
| 26 }; | |
| 27 | |
| 28 // See src/gpu/command_buffer/common/mailbox.h. | |
| 29 struct Mailbox { | |
| 30 array<int8, 64> name; | |
| 31 }; | |
| 32 | |
| 33 // See src/gpu/command_buffer/common/mailbox_holder.h. | |
| 34 struct MailboxHolder { | |
| 35 Mailbox mailbox; | |
| 36 uint32 texture_target; | |
| 37 uint32 sync_point; | |
| 38 }; | |
| 39 | |
| 40 // A TransferableResource is a graphics resource such as a texture or a bitmap | |
| 41 // in shared memory (software mode) that is shared between the View Manager and | |
| 42 // a client. This data structure is used to manage reuse of | |
| 43 // the memory once it is no longer needed by the View Manager and GPU service. | |
| 44 struct TransferableResource { | |
| 45 // |id| is an integer that uniquely identifies this resource in the client so | |
| 46 // that the View Manager can return this resource back to the client. | |
| 47 uint32 id; | |
| 48 ResourceFormat format; | |
| 49 uint32 filter; | |
| 50 Size size; | |
| 51 MailboxHolder mailbox_holder; | |
| 52 bool is_repeated; | |
| 53 bool is_software; | |
| 54 }; | |
| 55 | |
| 56 // See cc/output/compositor_frame_metadata.h. | |
| 57 struct CompositorFrameMetadata { | |
| 58 float device_scale_factor; | |
| 59 }; | |
| 60 | |
| 61 // See src/cc/output/compositor_frame.h. | |
| 62 struct CompositorFrame { | |
| 63 CompositorFrameMetadata metadata; | |
| 64 array<TransferableResource> resources; | |
| 65 array<Pass> passes; | |
| 66 }; | |
| 67 | |
| 68 // A Surface is an interface for receiving CompositorFrame structs. This is a | |
| 69 // separate interface to allow CompositorFrames to be delivered from | |
| 70 // supplementary (not main) threads of a mojo app. | |
| 71 interface Surface { | |
| 72 // After the submitted frame is drawn for the first time, the receiver will | |
| 73 // respond to the SubmitFrame message. Clients should use this acknowledgement | |
| 74 // to ratelimit frame submissions. | |
| 75 SubmitCompositorFrame(CompositorFrame frame) => (); | |
| 76 }; | |
| 77 | |
| 78 interface SurfaceClient { | |
| 79 ReturnResources(array<ReturnedResource> resources); | |
| 80 }; | |
| OLD | NEW |