Chromium Code Reviews| 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 23 matching lines...) Expand all Loading... | |
| 34 // | 34 // |
| 35 // Invisible targets are useful for explicitly suppressing hit testing | 35 // Invisible targets are useful for explicitly suppressing hit testing |
| 36 // for a node and its children when combined with the |prune| flag. | 36 // for a node and its children when combined with the |prune| flag. |
| 37 INVISIBLE, | 37 INVISIBLE, |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 // Specifies the visibility of the node for hit testing purposes. | 40 // Specifies the visibility of the node for hit testing purposes. |
| 41 // The default is opaque. | 41 // The default is opaque. |
| 42 Visibility visibility = Visibility.OPAQUE; | 42 Visibility visibility = Visibility.OPAQUE; |
| 43 | 43 |
| 44 // When set to true, prevents a node's children from being hit tested. | 44 // When set to true, prevents a node's children or reference scenes from |
| 45 // being hit tested. | |
| 45 bool prune = false; | 46 bool prune = false; |
| 46 | 47 |
| 47 // 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. |
| 48 // 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. |
| 49 // | 50 // |
| 50 // TODO(jeffbrown): Support more complex hit test regions and masks. | 51 // TODO(jeffbrown): Support more complex hit test regions and masks. |
| 51 mojo.Rect? hit_rect; | 52 mojo.Rect? hit_rect; |
| 52 }; | 53 }; |
| 53 | 54 |
| 54 // A hit testing service for scene graphs. | 55 // A hit testing service for scene graphs. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 | 91 |
| 91 // The version of the scene which was consulted at the time the hit test | 92 // The version of the scene which was consulted at the time the hit test |
| 92 // was performed. | 93 // was performed. |
| 93 uint32 scene_version; | 94 uint32 scene_version; |
| 94 | 95 |
| 95 // The array of hits within this scene, in dispatch order. | 96 // The array of hits within this scene, in dispatch order. |
| 96 // This list always contains at least one entry. | 97 // This list always contains at least one entry. |
| 97 array<Hit> hits; | 98 array<Hit> hits; |
| 98 }; | 99 }; |
| 99 | 100 |
| 100 // Describes the point of intersection of a hit test with a node. | 101 // Describes the intersection of a hit test with a node. |
| 101 struct NodeHit { | 102 struct NodeHit { |
| 102 // The node id of the node which was hit. | 103 // The node id of the node which was hit. |
| 103 uint32 node_id; | 104 uint32 node_id; |
| 104 | 105 |
| 105 // The coordinates of the hit within the node's content space. | 106 // The transformation from the global coordinate system of the scene graph |
| 106 mojo.Point intersection; | 107 // to the local coordinate system of the node's content space at the time |
| 108 // the hit test was performed. | |
| 109 // | |
| 110 // To obtain the point of intersection of the hit test within the node's | |
| 111 // content space, multiple this transformation matrix by the hit test point. | |
|
abarth
2016/03/09 04:02:48
s/multiple/multiply/
jeffbrown
2016/03/09 20:32:11
Done.
| |
| 112 mojo.Transform transform; | |
| 107 }; | 113 }; |
| OLD | NEW |