| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 [DartPackage="mojo_services"] | 5 [DartPackage="mojo_services"] |
| 6 module mojo.gfx.composition; | 6 module mojo.gfx.composition; |
| 7 | 7 |
| 8 import "mojo/services/geometry/interfaces/geometry.mojom"; | 8 import "mojo/services/geometry/interfaces/geometry.mojom"; |
| 9 import "mojo/services/gfx/composition/interfaces/hit_tests.mojom"; | 9 import "mojo/services/gfx/composition/interfaces/hit_tests.mojom"; |
| 10 import "mojo/services/gfx/composition/interfaces/scene_token.mojom"; | 10 import "mojo/services/gfx/composition/interfaces/scene_token.mojom"; |
| 11 import "mojo/services/gfx/composition/interfaces/scheduling.mojom"; |
| 11 | 12 |
| 12 // The renderer is a service which renders a scene graph to a display. | 13 // The renderer is a service which renders a scene graph to a display. |
| 13 // | 14 // |
| 14 // Use |Compositor.CreateRenderer()| to create a renderer. | 15 // Use |Compositor.CreateRenderer()| to create a renderer. |
| 15 interface Renderer { | 16 interface Renderer { |
| 16 // Sets the scene to be displayed by the renderer. | 17 // Sets the scene to be displayed by the renderer. |
| 17 // | 18 // |
| 18 // The |size| specifies the size of the output. | 19 // The |size| specifies the size of the output. |
| 19 // | 20 // |
| 20 // The |scene_token| specifies the scene which will be drawn as the | 21 // The |scene_token| specifies the scene which will be drawn as the |
| 21 // root of the scene graph. | 22 // root of the scene graph. |
| 22 // | 23 // |
| 23 // The |scene_version| specifies the version of the scene to render, | 24 // The |scene_version| specifies the version of the scene to render, |
| 24 // Use |kSceneVersionNone| to request the most recently published | 25 // Use |kSceneVersionNone| to request the most recently published |
| 25 // version of the scene if synchronization is unimportant. | 26 // version of the scene if synchronization is unimportant. |
| 26 // | 27 // |
| 27 // The |viewport| specifies the portion of the scene to render in pixels. | 28 // The |viewport| specifies the portion of the scene to render in pixels. |
| 28 // | 29 // |
| 29 // It is an error to create a renderer with an invalid |scene_token| | 30 // It is an error to create a renderer with an invalid |scene_token| |
| 30 // or |size|; the connection will be closed. | 31 // or |size|; the connection will be closed. |
| 31 // TODO: make this an event instead | 32 // TODO: make this an event instead |
| 32 SetRootScene(SceneToken scene_token, | 33 SetRootScene(SceneToken scene_token, |
| 33 uint32 scene_version, | 34 uint32 scene_version, |
| 34 mojo.Rect viewport); | 35 mojo.Rect viewport); |
| 35 | 36 |
| 36 // Dissociates the root scene from the renderer. | 37 // Dissociates the root scene from the renderer. |
| 37 ClearRootScene(); | 38 ClearRootScene(); |
| 38 | 39 |
| 40 // Gets a scheduler to receive frame timing information for the renderer. |
| 41 GetScheduler(FrameScheduler& scheduler); |
| 42 |
| 39 // Provides an interface which can be used to perform hit tests on the | 43 // Provides an interface which can be used to perform hit tests on the |
| 40 // contents of the renderer's scene graph. | 44 // contents of the renderer's scene graph. |
| 41 GetHitTester(HitTester& hit_tester); | 45 GetHitTester(HitTester& hit_tester); |
| 42 }; | 46 }; |
| OLD | NEW |