Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(857)

Side by Side Diff: components/mus/public/interfaces/compositor_frame.mojom

Issue 2020993004: Implement TransferableResource StructTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 mus.mojom; 5 module mus.mojom;
6 6
7 import "cc/ipc/returned_resource.mojom"; 7 import "cc/ipc/returned_resource.mojom";
8 import "cc/ipc/transferable_resource.mojom";
8 import "components/mus/public/interfaces/quads.mojom"; 9 import "components/mus/public/interfaces/quads.mojom";
9 import "ui/gfx/geometry/mojo/geometry.mojom"; 10 import "ui/gfx/geometry/mojo/geometry.mojom";
10 import "gpu/ipc/common/mailbox_holder.mojom"; 11 import "gpu/ipc/common/mailbox_holder.mojom";
11 import "gpu/ipc/common/sync_token.mojom"; 12 import "gpu/ipc/common/sync_token.mojom";
12 13
13 enum ResourceFormat {
14 RGBA_8888,
15 RGBA_4444,
16 BGRA_8888,
17 ALPHA_8,
18 LUMINANCE_8,
19 RGB_565,
20 ETC1,
21 };
22
23 // A TransferableResource is a graphics resource such as a texture or a bitmap
24 // in shared memory (software mode) that is shared between the window server and
25 // a client. This data structure is used to manage reuse of
26 // the memory once it is no longer needed by the window server and GPU service.
27 struct TransferableResource {
28 // |id| is an integer that uniquely identifies this resource in the client so
29 // that the window server can return this resource back to the client.
30 uint32 id;
31 ResourceFormat format;
32 uint32 filter;
33 mojo.Size size;
34 gpu.mojom.MailboxHolder mailbox_holder;
35 bool read_lock_fences_enabled;
36 bool is_software;
37 bool is_overlay_candidate;
38 };
39
40 // See cc/output/compositor_frame_metadata.h. 14 // See cc/output/compositor_frame_metadata.h.
41 struct CompositorFrameMetadata { 15 struct CompositorFrameMetadata {
42 float device_scale_factor; 16 float device_scale_factor;
43 }; 17 };
44 18
45 // See src/cc/output/compositor_frame.h. 19 // See src/cc/output/compositor_frame.h.
46 struct CompositorFrame { 20 struct CompositorFrame {
47 CompositorFrameMetadata metadata; 21 CompositorFrameMetadata metadata;
48 array<TransferableResource> resources; 22 array<cc.mojom.TransferableResource> resources;
49 array<Pass> passes; 23 array<Pass> passes;
50 }; 24 };
51 25
52 // A Surface is an interface for receiving CompositorFrame structs. This is a 26 // A Surface is an interface for receiving CompositorFrame structs. This is a
53 // separate interface to allow CompositorFrames to be delivered from 27 // separate interface to allow CompositorFrames to be delivered from
54 // supplementary (not main) threads of a mojo app. 28 // supplementary (not main) threads of a mojo app.
55 interface Surface { 29 interface Surface {
56 // After the submitted frame is drawn for the first time, the receiver will 30 // After the submitted frame is drawn for the first time, the receiver will
57 // respond to the SubmitFrame message. Clients should use this acknowledgement 31 // respond to the SubmitFrame message. Clients should use this acknowledgement
58 // to ratelimit frame submissions. 32 // to ratelimit frame submissions.
59 SubmitCompositorFrame(CompositorFrame frame) => (); 33 SubmitCompositorFrame(CompositorFrame frame) => ();
60 }; 34 };
61 35
62 interface SurfaceClient { 36 interface SurfaceClient {
63 ReturnResources(array<cc.mojom.ReturnedResource> resources); 37 ReturnResources(array<cc.mojom.ReturnedResource> resources);
64 }; 38 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698