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

Side by Side Diff: components/mus/public/interfaces/gpu/display_compositor.mojom

Issue 1989693002: Introduce DisplayCompositor Mojo API for Mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix client_id 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
(Empty)
1 // Copyright 2016 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 mus.gpu.mojom;
6
7 import "components/mus/public/interfaces/compositor_frame.mojom";
8
9
10 // Indicates whether the submitted CompositorFrame has been drawn to the display
11 // or has been skipped (e.g. another frame may have been submitted before
12 // vblank).
13 enum CompositorFrameDrawStatus {
14 DRAW_SKIPPED,
15 DRAWN
16 };
17
18 // A CompositorFrameSinkFactory represents a single Display client.
19 // The client (a process) can use this interface to create
20 // CompositorFrameSinks.
21 // TODO(fsamuel): This needs a better name.
22 interface CompositorFrameSinkFactory {
23 // Requests a CompositorFrameSink interface from the display compositor.
24 // A CompositorFrameSink has an associated ID consisting of three components:
25 // 1. Namespace picked by the service associated with this
26 // CompositorFrameSinkFactory.
27 // 2. |local_id| which is a monotonically increasing ID allocated by the
28 // client.
29 // 3. |nonce| is a cryptographically secure random number making this Sink
30 // unguessable by other clients.
31 CreateCompositorFrameSink(uint32 local_id,
32 uint64 nonce,
33 CompositorFrameSink& sink,
34 CompositorFrameSinkClient client);
35 };
36
37 // A CompositorFrameSink is an interface for receiving CompositorFrame structs.
38 // A CompositorFrame contains the complete output meant for display. Each time a
39 // client has a graphical update, and receives an OnBeginFrame, it is
40 // responsible for creating a CompositorFrame to update its portion of the
41 // screen.
42 interface CompositorFrameSink {
43 // After the submitted frame is either drawn for the first time by the display
44 // compositor or discarded, the callback will be called with the status of the
45 // submitted frame. Clients should use this acknowledgement to ratelimit frame
46 // submissions.
47 // TODO(fsamuel): We should support identifying the CF in the callback.
48 SubmitCompositorFrame(mus.mojom.CompositorFrame frame) =>
49 (CompositorFrameDrawStatus status);
50
51 // Lets the display compositor know that the client wishes to receive the next
52 // BeginFrame event.
53 SetNeedsBeginFrame(bool needs_begin_frame);
54
55 // TODO(fsamuel): ReadbackBitmap API would be useful here.
56 };
57
58 interface CompositorFrameSinkClient {
59 ReturnResources(array<mus.mojom.ReturnedResource> resources);
60 };
61
62 // This is a public interface implemented by Display clients.
63 // Each client implements a single instance of the DisplayClient interface.
64 interface DisplayClient {
65 // Clients can register CompositorFrameSinks via the provided |factory|.
66 OnClientCreated(uint32 client_id, CompositorFrameSinkFactory factory);
67
68 // TODO(fsamuel): OnBeginFrame needs to take a BeginFrameArgs instance per
69 // cc/output/begin_frame_args.h.
70 OnBeginFrame();
71 };
OLDNEW
« no previous file with comments | « components/mus/public/interfaces/gpu/BUILD.gn ('k') | components/mus/public/interfaces/gpu/display_compositor_host.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698