OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 [DartPackage="mojo_services"] |
| 6 module mojo.gfx.composition; |
| 7 |
| 8 import "mojo/services/geometry/interfaces/geometry.mojom"; |
| 9 import "mojo/services/gpu/interfaces/context_provider.mojom"; |
| 10 import "mojo/services/gfx/composition/interfaces/scene_token.mojom"; |
| 11 import "mojo/services/gfx/composition/interfaces/scenes.mojom"; |
| 12 import "mojo/services/gfx/composition/interfaces/renderers.mojom"; |
| 13 |
| 14 // Maximum length for a scene or renderer label. |
| 15 const uint32 kLabelMaxLength = 32; |
| 16 |
| 17 // The compositor manages scenes and scene graph renderers. |
| 18 // |
| 19 // Applications create scenes to describe graphical content they would like |
| 20 // to render, including references to other scenes they would like to compose. |
| 21 // |
| 22 // The system creates a renderer to bind a scene graph to a particular display. |
| 23 // |
| 24 // Refer to |Scene| and |Renderer| for more information about these objects. |
| 25 [ServiceName="mojo::gfx::composition::Compositor"] |
| 26 interface Compositor { |
| 27 // Creates a scene. |
| 28 // |
| 29 // The |scene| is used to supply content for the scene. The scene pipe |
| 30 // is private to the scene and should not be shared with anyone else. |
| 31 // |
| 32 // The |scene_token| is used as a transferable reference which can be passed |
| 33 // to owners of other scenes to allow them to embed this scene as a |
| 34 // resource. The compositor itself does not describe how this interaction |
| 35 // should take place, only that the token may eventually be used to |
| 36 // construct a |SceneResource|. |
| 37 // |
| 38 // The |label| is an optional name to associate with the view for |
| 39 // diagnostic purposes. The label will be truncated if it is longer |
| 40 // than |kLabelMaxLength|. |
| 41 // |
| 42 // To unregister the scene, simply close the |scene| message pipe. |
| 43 CreateScene(Scene& scene, string? label) => (SceneToken scene_token); |
| 44 |
| 45 // Creates a scene graph renderer. |
| 46 // |
| 47 // The |context_provider| provides the GL Context to which the content |
| 48 // should be rendered. This will typically be a display. |
| 49 // |
| 50 // The |label| is an optional name to associate with the renderer for |
| 51 // diagnostic purposes. The label will be truncated if it is longer |
| 52 // than |kLabelMaxLength|. |
| 53 // |
| 54 // To destroy the renderer, simply close the |renderer| message pipe. |
| 55 CreateRenderer(mojo.ContextProvider context_provider, |
| 56 Renderer& renderer, string? label); |
| 57 }; |
OLD | NEW |