| 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/gfx/composition/interfaces/nodes.mojom"; | 8 import "mojo/services/gfx/composition/interfaces/nodes.mojom"; |
| 9 import "mojo/services/gfx/composition/interfaces/resources.mojom"; | 9 import "mojo/services/gfx/composition/interfaces/resources.mojom"; |
| 10 import "mojo/services/gfx/composition/interfaces/scene_token.mojom"; | 10 import "mojo/services/gfx/composition/interfaces/scene_token.mojom"; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // B's old content. | 110 // B's old content. |
| 111 // | 111 // |
| 112 // - Speculate: The compositor could allow X to provide alternate descriptions | 112 // - Speculate: The compositor could allow X to provide alternate descriptions |
| 113 // of the scene in the case where A or B are not keeping up so that it | 113 // of the scene in the case where A or B are not keeping up so that it |
| 114 // can more finely control the recovery policy. | 114 // can more finely control the recovery policy. |
| 115 // | 115 // |
| 116 // To maximize concurrency, we adopt the latter approach. | 116 // To maximize concurrency, we adopt the latter approach. |
| 117 // | 117 // |
| 118 // SCHEDULING | 118 // SCHEDULING |
| 119 // | 119 // |
| 120 // The scene provides support for scheduling update via its associated | 120 // The scene provides support for scheduling frames via its associated |
| 121 // |SceneScheduler| interface. Use the scheduler to obtain frame timing | 121 // |FrameScheduler| interface. Use the scheduler to obtain frame timing |
| 122 // information and to throttle updates to match the display refresh rate | 122 // information and to throttle updates to match the display refresh rate |
| 123 // (ie. with vsync). | 123 // (ie. with vsync). |
| 124 interface Scene { | 124 interface Scene { |
| 125 // Sets the listener for receiving events from the scene. | 125 // Sets the listener for receiving events from the scene. |
| 126 // | 126 // |
| 127 // If |listener| is null, then the previously set listener is removed. | 127 // If |listener| is null, then the previously set listener is removed. |
| 128 SetListener(SceneListener? listener); | 128 SetListener(SceneListener? listener); |
| 129 | 129 |
| 130 // Applies a batch of incremental updates to the contents of the scene. | 130 // Applies a batch of incremental updates to the contents of the scene. |
| 131 // | 131 // |
| (...skipping 16 matching lines...) Expand all Loading... |
| 148 // The |metadata| describes how the published scene should be presented. | 148 // The |metadata| describes how the published scene should be presented. |
| 149 // If null, this method behaves as if a |SceneMetadata| object initialized | 149 // If null, this method behaves as if a |SceneMetadata| object initialized |
| 150 // with default values had been supplied. | 150 // with default values had been supplied. |
| 151 // | 151 // |
| 152 // Publishing a scene graph applies all pending updates. It is an error | 152 // Publishing a scene graph applies all pending updates. It is an error |
| 153 // to publish updates which cause the scene state to become inconsistent, | 153 // to publish updates which cause the scene state to become inconsistent, |
| 154 // such as by having nodes which refer to non-existent resources or | 154 // such as by having nodes which refer to non-existent resources or |
| 155 // introducing cycles in the scene's nodes; the connection will be closed. | 155 // introducing cycles in the scene's nodes; the connection will be closed. |
| 156 Publish(SceneMetadata? metadata); | 156 Publish(SceneMetadata? metadata); |
| 157 | 157 |
| 158 // Gets a scheduler for scheduling upcoming scene operations. | 158 // Gets a scheduler to receive frame timing information for the scene. |
| 159 GetScheduler(SceneScheduler& scheduler); | 159 GetScheduler(FrameScheduler& scheduler); |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 // An interface applications may implement to receive events from a scene. | 162 // An interface applications may implement to receive events from a scene. |
| 163 interface SceneListener { | 163 interface SceneListener { |
| 164 // Called when a resource has become unavailable. | 164 // Called when a resource has become unavailable. |
| 165 // | 165 // |
| 166 // Any nodes which are using the resource will be considered blocked | 166 // Any nodes which are using the resource will be considered blocked |
| 167 // until the resource is replaced or the nodes using it are removed. | 167 // until the resource is replaced or the nodes using it are removed. |
| 168 OnResourceUnavailable(uint32 resource_id) => (); | 168 OnResourceUnavailable(uint32 resource_id) => (); |
| 169 }; | 169 }; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // scene are to be shown on the display output assuming everything is | 215 // scene are to be shown on the display output assuming everything is |
| 216 // fully rendered and submitted by the appropriate deadline. | 216 // fully rendered and submitted by the appropriate deadline. |
| 217 // | 217 // |
| 218 // Expressed in microseconds in the |MojoTimeTicks| timebase. | 218 // Expressed in microseconds in the |MojoTimeTicks| timebase. |
| 219 // | 219 // |
| 220 // A value of 0 means "as soon as possible". | 220 // A value of 0 means "as soon as possible". |
| 221 // | 221 // |
| 222 // See also: |FrameInfo.presentation_time|. | 222 // See also: |FrameInfo.presentation_time|. |
| 223 int64 presentation_time = 0; | 223 int64 presentation_time = 0; |
| 224 }; | 224 }; |
| OLD | NEW |