Chromium Code Reviews| 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 cc.mojom; | 5 module cc.mojom; |
| 6 | 6 |
| 7 import "cc/ipc/frame_sink_id.mojom"; | 7 import "cc/ipc/frame_sink_id.mojom"; |
| 8 import "cc/ipc/mojo_compositor_frame_sink.mojom"; | 8 import "cc/ipc/mojo_compositor_frame_sink.mojom"; |
| 9 import "cc/ipc/surface_id.mojom"; | 9 import "cc/ipc/surface_id.mojom"; |
| 10 import "cc/ipc/surface_sequence.mojom"; | 10 import "cc/ipc/surface_sequence.mojom"; |
| 11 import "gpu/ipc/common/surface_handle.mojom"; | 11 import "gpu/ipc/common/surface_handle.mojom"; |
| 12 import "mojo/common/time.mojom"; | |
| 12 import "ui/gfx/geometry/mojo/geometry.mojom"; | 13 import "ui/gfx/geometry/mojo/geometry.mojom"; |
| 14 import "ui/gfx/mojo/color_space.mojom"; | |
| 15 | |
| 16 // See cc/surfaces/display.h | |
|
rjkroege
2016/12/20 00:51:51
I'd like the .mojom to have more detailed document
Alex Z.
2016/12/20 15:36:52
Currently ash talks to cc::Display through Context
Alex Z.
2016/12/20 15:49:11
Done.
rjkroege
2016/12/20 19:18:08
Given the above, it's not appropriate to reference
Alex Z.
2016/12/20 19:55:54
Done.
| |
| 17 interface DisplayPrivate { | |
| 18 SetDisplayVisible(bool visible); | |
| 19 ResizeDisplay(gfx.mojom.Size size_in_pixel); | |
| 20 SetDisplayColorSpace(gfx.mojom.ColorSpace color_space); | |
| 21 SetOutputIsSecure(bool secure); | |
| 22 }; | |
| 13 | 23 |
| 14 // The DisplayCompositor interface is a privileged interface that allows | 24 // The DisplayCompositor interface is a privileged interface that allows |
| 15 // the display compositor host (browser or window server) to create | 25 // the display compositor host (browser or window server) to create |
| 16 // CompositorFrameSinks. Clients acquire a CompositorFrameSink connection | 26 // CompositorFrameSinks. Clients acquire a CompositorFrameSink connection |
| 17 // through the display compositor host. Clients request a | 27 // through the display compositor host. Clients request a |
| 18 // MojoCompositorFrameSink interface, and implement a | 28 // MojoCompositorFrameSink interface, and implement a |
| 19 // MojoCompositorFrameSinkClient interface. The display compositor host | 29 // MojoCompositorFrameSinkClient interface. The display compositor host |
| 20 // holds one or more root CompositorFrameSinks that are tied to a valid | 30 // holds one or more root CompositorFrameSinks that are tied to a valid |
| 21 // |surface_handle|. All other CompositorFrameSinks are offscreen. FrameSinkIds | 31 // |surface_handle|. All other CompositorFrameSinks are offscreen. FrameSinkIds |
| 22 // are fixed for a given client and are determined ahead of time. Thus, a client | 32 // are fixed for a given client and are determined ahead of time. Thus, a client |
| 23 // will typically simply request a CompositorFrameSink from the display | 33 // will typically simply request a CompositorFrameSink from the display |
| 24 // compositor host which will forward the request to the display compositor. | 34 // compositor host which will forward the request to the display compositor. |
| 25 interface DisplayCompositor { | 35 interface DisplayCompositor { |
| 36 // Create a CompositorFrameSink for a privileged client (e.g. WindowServer). | |
| 37 // This is only used by privileged clients. The client can call methods that | |
| 38 // talks to the cc::Display (e.g. ResizeDisplay(), SetDisplayVisible(), etc) | |
| 26 CreateDisplayCompositorFrameSink( | 39 CreateDisplayCompositorFrameSink( |
| 27 cc.mojom.FrameSinkId frame_sink_id, | 40 cc.mojom.FrameSinkId frame_sink_id, |
| 28 gpu.mojom.SurfaceHandle widget, | 41 gpu.mojom.SurfaceHandle widget, |
| 29 cc.mojom.MojoCompositorFrameSink& compositor_frame_sink, | 42 cc.mojom.MojoCompositorFrameSink& compositor_frame_sink, |
| 30 cc.mojom.MojoCompositorFrameSinkPrivate& compositor_frame_sink_private, | 43 cc.mojom.MojoCompositorFrameSinkPrivate& compositor_frame_sink_private, |
| 31 cc.mojom.MojoCompositorFrameSinkClient compositor_frame_sink_client); | 44 cc.mojom.MojoCompositorFrameSinkClient compositor_frame_sink_client, |
| 45 DisplayPrivate& display_private); | |
| 32 | 46 |
| 47 // CreateOffscreenCompositorFrameSink is used by non-privileged clients. | |
| 48 // An off screen CompositorFrameSink only submits frames to a buffer instead | |
| 49 // of a display. | |
| 33 CreateOffscreenCompositorFrameSink( | 50 CreateOffscreenCompositorFrameSink( |
| 34 cc.mojom.FrameSinkId frame_sink_id, | 51 cc.mojom.FrameSinkId frame_sink_id, |
| 35 cc.mojom.MojoCompositorFrameSink& compositor_frame_sink, | 52 cc.mojom.MojoCompositorFrameSink& compositor_frame_sink, |
| 36 cc.mojom.MojoCompositorFrameSinkPrivate& compositor_frame_sink_private, | 53 cc.mojom.MojoCompositorFrameSinkPrivate& compositor_frame_sink_private, |
| 37 cc.mojom.MojoCompositorFrameSinkClient compositor_frame_sink_client); | 54 cc.mojom.MojoCompositorFrameSinkClient compositor_frame_sink_client); |
| 38 }; | 55 }; |
| 39 | 56 |
| 40 // The DisplayCompositorClient interface is implemented by the Display | 57 // The DisplayCompositorClient interface is implemented by the Display |
| 41 // Compositor Host, a stable, and privileged peer service to the display | 58 // Compositor Host, a stable, and privileged peer service to the display |
| 42 // compositor. The display compositor host is either the browser process in | 59 // compositor. The display compositor host is either the browser process in |
| 43 // Chrome or the window server process. | 60 // Chrome or the window server process. |
| 44 interface DisplayCompositorClient { | 61 interface DisplayCompositorClient { |
| 45 // Called by the display compostor when it is created. Provides the top level | 62 // Called by the display compostor when it is created. Provides the top level |
| 46 // root surface id that should reference display roots. This will always be | 63 // root surface id that should reference display roots. This will always be |
| 47 // the first message sent. | 64 // the first message sent. |
| 48 OnDisplayCompositorCreated(cc.mojom.SurfaceId root_surface_id); | 65 OnDisplayCompositorCreated(cc.mojom.SurfaceId root_surface_id); |
| 49 | 66 |
| 50 // Called by the display compositor immediately upon receiving a | 67 // Called by the display compositor immediately upon receiving a |
| 51 // CompositorFrame with a new SurfaceId for the first time. | 68 // CompositorFrame with a new SurfaceId for the first time. |
| 52 OnSurfaceCreated(cc.mojom.SurfaceId surface_id, | 69 OnSurfaceCreated(cc.mojom.SurfaceId surface_id, |
| 53 gfx.mojom.Size frame_size, | 70 gfx.mojom.Size frame_size, |
| 54 float device_scale_factor); | 71 float device_scale_factor); |
| 55 }; | 72 }; |
| OLD | NEW |