| OLD | NEW |
| (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 cc.mojom; | |
| 6 | |
| 7 import "cc/ipc/frame_sink_id.mojom"; | |
| 8 import "cc/ipc/local_surface_id.mojom"; | |
| 9 import "cc/ipc/mojo_compositor_frame_sink.mojom"; | |
| 10 import "cc/ipc/surface_id.mojom"; | |
| 11 import "cc/ipc/surface_info.mojom"; | |
| 12 import "gpu/ipc/common/surface_handle.mojom"; | |
| 13 import "mojo/common/time.mojom"; | |
| 14 import "ui/gfx/geometry/mojo/geometry.mojom"; | |
| 15 import "ui/gfx/mojo/color_space.mojom"; | |
| 16 | |
| 17 // See ui/compositor/compositor.h: ContextFactoryPrivate. | |
| 18 // The DisplayPrivate is used by privileged clients to talk to cc::Display. | |
| 19 // DisplayPrivate would eventually replace or be used by ContextFactoryPrivate. | |
| 20 interface DisplayPrivate { | |
| 21 SetDisplayVisible(bool visible); | |
| 22 ResizeDisplay(gfx.mojom.Size size_in_pixel); | |
| 23 SetDisplayColorSpace(gfx.mojom.ColorSpace color_space); | |
| 24 SetOutputIsSecure(bool secure); | |
| 25 SetLocalSurfaceId(cc.mojom.LocalSurfaceId local_surface_id, | |
| 26 float scale_factor); | |
| 27 }; | |
| 28 | |
| 29 // The DisplayCompositor interface is a privileged interface that allows | |
| 30 // the display compositor host (browser or window server) to create | |
| 31 // CompositorFrameSinks. Clients acquire a CompositorFrameSink connection | |
| 32 // through the display compositor host. Clients request a | |
| 33 // MojoCompositorFrameSink interface, and implement a | |
| 34 // MojoCompositorFrameSinkClient interface. The display compositor host | |
| 35 // holds one or more root CompositorFrameSinks that are tied to a valid | |
| 36 // |surface_handle|. All other CompositorFrameSinks are offscreen. FrameSinkIds | |
| 37 // are fixed for a given client and are determined ahead of time. Thus, a client | |
| 38 // will typically simply request a CompositorFrameSink from the display | |
| 39 // compositor host which will forward the request to the display compositor. | |
| 40 interface DisplayCompositor { | |
| 41 // Create a CompositorFrameSink for a privileged client (e.g. WindowServer). | |
| 42 // This is only used by privileged clients. The client can call methods that | |
| 43 // talks to the Display (e.g. ResizeDisplay(), SetDisplayVisible(), etc) | |
| 44 CreateRootCompositorFrameSink( | |
| 45 cc.mojom.FrameSinkId frame_sink_id, | |
| 46 gpu.mojom.SurfaceHandle widget, | |
| 47 associated cc.mojom.MojoCompositorFrameSink& compositor_frame_sink, | |
| 48 cc.mojom.MojoCompositorFrameSinkPrivate& compositor_frame_sink_private, | |
| 49 cc.mojom.MojoCompositorFrameSinkClient compositor_frame_sink_client, | |
| 50 associated DisplayPrivate& display_private); | |
| 51 | |
| 52 // CreateCompositorFrameSink is used by unprivileged clients. | |
| 53 // This CompositorFrameSink is not a root, and has to be parented by another | |
| 54 // CompositorFrameSink in order to appear on screen. | |
| 55 CreateCompositorFrameSink( | |
| 56 cc.mojom.FrameSinkId frame_sink_id, | |
| 57 cc.mojom.MojoCompositorFrameSink& compositor_frame_sink, | |
| 58 cc.mojom.MojoCompositorFrameSinkPrivate& compositor_frame_sink_private, | |
| 59 cc.mojom.MojoCompositorFrameSinkClient compositor_frame_sink_client); | |
| 60 | |
| 61 // Set up a BeginFrame relationship between two FrameSinkIds. In this case, | |
| 62 // the child inherits the BeginFrameSource from the parent if it doesn't | |
| 63 // already have a BeginFrameSource. | |
| 64 RegisterFrameSinkHierarchy(cc.mojom.FrameSinkId parent_frame_sink_id, | |
| 65 cc.mojom.FrameSinkId child_frame_sink_id); | |
| 66 | |
| 67 // Removes a BeginFrame relationship between two FrameSinkIds. | |
| 68 UnregisterFrameSinkHierarchy(cc.mojom.FrameSinkId parent_frame_sink_id, | |
| 69 cc.mojom.FrameSinkId child_frame_sink_id); | |
| 70 | |
| 71 // Drops the temporary reference for |surface_id|. This will get called when | |
| 72 // the DisplayCompositorClient doesn't think |surface_id| will be embedded. | |
| 73 DropTemporaryReference(cc.mojom.SurfaceId surface_id); | |
| 74 }; | |
| 75 | |
| 76 // The DisplayCompositorClient interface is implemented by the Display | |
| 77 // Compositor Host, a stable, and privileged peer service to the display | |
| 78 // compositor. The display compositor host is either the browser process in | |
| 79 // Chrome or the window server process. | |
| 80 interface DisplayCompositorClient { | |
| 81 // Called by the display compositor immediately upon receiving a | |
| 82 // CompositorFrame with a new SurfaceId for the first time. | |
| 83 OnSurfaceCreated(SurfaceInfo surface_info); | |
| 84 }; | |
| OLD | NEW |