| 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/scene_token.mojom"; | 9 import "mojo/services/gfx/composition/interfaces/scene_token.mojom"; |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 Visibility visibility = Visibility.OPAQUE; | 42 Visibility visibility = Visibility.OPAQUE; |
| 43 | 43 |
| 44 // When set to true, prevents a node's children or reference scenes from | 44 // When set to true, prevents a node's children or reference scenes from |
| 45 // being hit tested. | 45 // being hit tested. |
| 46 bool prune = false; | 46 bool prune = false; |
| 47 | 47 |
| 48 // The rectangle within the node's content space to test for hits. | 48 // The rectangle within the node's content space to test for hits. |
| 49 // If null, the node's entire clip region is tested for hits. | 49 // If null, the node's entire clip region is tested for hits. |
| 50 // | 50 // |
| 51 // TODO(jeffbrown): Support more complex hit test regions and masks. | 51 // TODO(jeffbrown): Support more complex hit test regions and masks. |
| 52 mojo.Rect? hit_rect; | 52 mojo.RectF? hit_rect; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 // A hit testing service for scene graphs. | 55 // A hit testing service for scene graphs. |
| 56 interface HitTester { | 56 interface HitTester { |
| 57 // Performs a hit test on the specified point. | 57 // Performs a hit test on the specified point. |
| 58 // | 58 // |
| 59 // TODO(jeffbrown): Specify a presentation timestamp to allow for | 59 // TODO(jeffbrown): Specify a presentation timestamp to allow for |
| 60 // hit-tests of geometry as it appeared to the user in the recent past. | 60 // hit-tests of geometry as it appeared to the user in the recent past. |
| 61 HitTest(mojo.Point point) => (HitTestResult result); | 61 HitTest(mojo.PointF point) => (HitTestResult result); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 // The result of a hit test operation. | 64 // The result of a hit test operation. |
| 65 // | 65 // |
| 66 // Hit test results form a hit tree with information about the nodes which | 66 // Hit test results form a hit tree with information about the nodes which |
| 67 // were hit and the scenes which contain them. The structure of the hit | 67 // were hit and the scenes which contain them. The structure of the hit |
| 68 // tree reflects the path that the scene graph was traversed during the | 68 // tree reflects the path that the scene graph was traversed during the |
| 69 // hit test. | 69 // hit test. |
| 70 // | 70 // |
| 71 // To walk the hit nodes in dispatch order, perform a post-order traversal | 71 // To walk the hit nodes in dispatch order, perform a post-order traversal |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 uint32 node_id; | 104 uint32 node_id; |
| 105 | 105 |
| 106 // The transformation from the global coordinate system of the scene graph | 106 // The transformation from the global coordinate system of the scene graph |
| 107 // to the local coordinate system of the node's content space at the time | 107 // to the local coordinate system of the node's content space at the time |
| 108 // the hit test was performed. | 108 // the hit test was performed. |
| 109 // | 109 // |
| 110 // To obtain the point of intersection of the hit test within the node's | 110 // To obtain the point of intersection of the hit test within the node's |
| 111 // content space, multiply this transformation matrix by the hit test point. | 111 // content space, multiply this transformation matrix by the hit test point. |
| 112 mojo.Transform transform; | 112 mojo.Transform transform; |
| 113 }; | 113 }; |
| OLD | NEW |