OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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.gpu.mojom; | 5 module mus.gpu.mojom; |
6 | 6 |
| 7 import "cc/ipc/compositor_frame.mojom"; |
7 import "cc/ipc/returned_resource.mojom"; | 8 import "cc/ipc/returned_resource.mojom"; |
8 import "components/mus/public/interfaces/compositor_frame.mojom"; | |
9 | 9 |
10 | 10 |
11 // Indicates whether the submitted CompositorFrame has been drawn to the display | 11 // Indicates whether the submitted CompositorFrame has been drawn to the display |
12 // or has been skipped (e.g. another frame may have been submitted before | 12 // or has been skipped (e.g. another frame may have been submitted before |
13 // vblank). | 13 // vblank). |
14 enum CompositorFrameDrawStatus { | 14 enum CompositorFrameDrawStatus { |
15 DRAW_SKIPPED, | 15 DRAW_SKIPPED, |
16 DRAWN | 16 DRAWN |
17 }; | 17 }; |
18 | 18 |
(...skipping 20 matching lines...) Expand all Loading... |
39 // A CompositorFrame contains the complete output meant for display. Each time a | 39 // A CompositorFrame contains the complete output meant for display. Each time a |
40 // client has a graphical update, and receives an OnBeginFrame, it is | 40 // client has a graphical update, and receives an OnBeginFrame, it is |
41 // responsible for creating a CompositorFrame to update its portion of the | 41 // responsible for creating a CompositorFrame to update its portion of the |
42 // screen. | 42 // screen. |
43 interface CompositorFrameSink { | 43 interface CompositorFrameSink { |
44 // After the submitted frame is either drawn for the first time by the display | 44 // After the submitted frame is either drawn for the first time by the display |
45 // compositor or discarded, the callback will be called with the status of the | 45 // compositor or discarded, the callback will be called with the status of the |
46 // submitted frame. Clients should use this acknowledgement to ratelimit frame | 46 // submitted frame. Clients should use this acknowledgement to ratelimit frame |
47 // submissions. | 47 // submissions. |
48 // TODO(fsamuel): We should support identifying the CF in the callback. | 48 // TODO(fsamuel): We should support identifying the CF in the callback. |
49 SubmitCompositorFrame(mus.mojom.CompositorFrame frame) => | 49 SubmitCompositorFrame(cc.mojom.CompositorFrame frame) => |
50 (CompositorFrameDrawStatus status); | 50 (CompositorFrameDrawStatus status); |
51 | 51 |
52 // Lets the display compositor know that the client wishes to receive the next | 52 // Lets the display compositor know that the client wishes to receive the next |
53 // BeginFrame event. | 53 // BeginFrame event. |
54 SetNeedsBeginFrame(bool needs_begin_frame); | 54 SetNeedsBeginFrame(bool needs_begin_frame); |
55 | 55 |
56 // TODO(fsamuel): ReadbackBitmap API would be useful here. | 56 // TODO(fsamuel): ReadbackBitmap API would be useful here. |
57 }; | 57 }; |
58 | 58 |
59 interface CompositorFrameSinkClient { | 59 interface CompositorFrameSinkClient { |
60 ReturnResources(array<cc.mojom.ReturnedResource> resources); | 60 ReturnResources(array<cc.mojom.ReturnedResource> resources); |
61 }; | 61 }; |
62 | 62 |
63 // This is a public interface implemented by Display clients. | 63 // This is a public interface implemented by Display clients. |
64 // Each client implements a single instance of the DisplayClient interface. | 64 // Each client implements a single instance of the DisplayClient interface. |
65 interface DisplayClient { | 65 interface DisplayClient { |
66 // Clients can register CompositorFrameSinks via the provided |factory|. | 66 // Clients can register CompositorFrameSinks via the provided |factory|. |
67 OnClientCreated(uint32 client_id, CompositorFrameSinkFactory factory); | 67 OnClientCreated(uint32 client_id, CompositorFrameSinkFactory factory); |
68 | 68 |
69 // TODO(fsamuel): OnBeginFrame needs to take a BeginFrameArgs instance per | 69 // TODO(fsamuel): OnBeginFrame needs to take a BeginFrameArgs instance per |
70 // cc/output/begin_frame_args.h. | 70 // cc/output/begin_frame_args.h. |
71 OnBeginFrame(); | 71 OnBeginFrame(); |
72 }; | 72 }; |
OLD | NEW |