Chromium Code Reviews| 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/gfx/composition/interfaces/scene_token.mojom"; | |
| 10 | |
| 11 // Indicates that hit testing is not needed for a given node. | |
| 12 const uint32 kHitIdNone = 0; | |
| 13 | |
| 14 // Provides information about the point of intersection of a hit test with | |
| 15 // a node in a scene graph. | |
| 16 struct Hit { | |
| 17 // The scene token of the scene which was hit. | |
| 18 SceneToken scene_token; | |
| 19 | |
| 20 // The version of the scene which was consulted as part of evaluating the | |
| 21 // hit test. | |
| 22 uint32 scene_version; | |
| 23 | |
| 24 // The node id of the node which was hit. | |
| 25 uint32 node_id; | |
| 26 | |
| 27 // The hit test id of the node which was hit. | |
| 28 uint32 hit_id; | |
| 29 | |
| 30 // The coordinates of the hit within the node's content space. | |
| 31 mojo.Point intersection; | |
| 32 }; | |
| 33 | |
| 34 // The result of a hit test operation. | |
| 35 struct HitTestResult { | |
| 36 // A sorted list of hits tracing a path from the root of the scene graph | |
| 37 // to the innermost hit node, or null if none. Omits nodes for which | |
| 38 // the hit_id was |kHitIdNone|. | |
| 39 array<Hit> hits; | |
|
abarth
2016/01/10 04:22:08
I'm not sure it matters much, but this is backward
jeffbrown
2016/01/16 03:28:31
Good point. I changed the description but I'll co
| |
| 40 }; | |
| 41 | |
| 42 // A hit testing service for scene graphs. | |
| 43 interface HitTester { | |
| 44 // Performs a hit test on the specified point. | |
| 45 // | |
| 46 // TODO(jeffbrown): Specify a timestamp to allow for hit-tests of geometry | |
| 47 // as it appeared in the recent past. | |
| 48 HitTest(mojo.Point point) => (HitTestResult result); | |
| 49 }; | |
| OLD | NEW |