Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1006)

Unified Diff: mojo/services/gfx/composition/interfaces/hit_tests.mojom

Issue 1552963002: Initial checkin of the new Mozart compositor. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-11
Patch Set: Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/services/gfx/composition/interfaces/hit_tests.mojom
diff --git a/mojo/services/gfx/composition/interfaces/hit_tests.mojom b/mojo/services/gfx/composition/interfaces/hit_tests.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..0a9d7c017f7ca044d44598beda9df50cdc8ebbc3
--- /dev/null
+++ b/mojo/services/gfx/composition/interfaces/hit_tests.mojom
@@ -0,0 +1,49 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[DartPackage="mojo_services"]
+module mojo.gfx.composition;
+
+import "mojo/services/geometry/interfaces/geometry.mojom";
+import "mojo/services/gfx/composition/interfaces/scene_token.mojom";
+
+// Indicates that hit testing is not needed for a given node.
+const uint32 kHitIdNone = 0;
+
+// Provides information about the point of intersection of a hit test with
+// a node in a scene graph.
+struct Hit {
+ // The scene token of the scene which was hit.
+ SceneToken scene_token;
+
+ // The version of the scene which was consulted as part of evaluating the
+ // hit test.
+ uint32 scene_version;
+
+ // The node id of the node which was hit.
+ uint32 node_id;
+
+ // The hit test id of the node which was hit.
+ uint32 hit_id;
+
+ // The coordinates of the hit within the node's content space.
+ mojo.Point intersection;
+};
+
+// The result of a hit test operation.
+struct HitTestResult {
+ // A sorted list of hits tracing a path from the root of the scene graph
+ // to the innermost hit node, or null if none. Omits nodes for which
+ // the hit_id was |kHitIdNone|.
+ 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
+};
+
+// A hit testing service for scene graphs.
+interface HitTester {
+ // Performs a hit test on the specified point.
+ //
+ // TODO(jeffbrown): Specify a timestamp to allow for hit-tests of geometry
+ // as it appeared in the recent past.
+ HitTest(mojo.Point point) => (HitTestResult result);
+};

Powered by Google App Engine
This is Rietveld 408576698