Index: services/viz/hit_test/public/interfaces/hit_test_data.mojom |
diff --git a/services/viz/hit_test/public/interfaces/hit_test_data.mojom b/services/viz/hit_test/public/interfaces/hit_test_data.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2e12ae0a9fa46a9c9d15ab947c5e933c1db856f7 |
--- /dev/null |
+++ b/services/viz/hit_test/public/interfaces/hit_test_data.mojom |
@@ -0,0 +1,60 @@ |
+// Copyright 2017 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. |
+ |
+module viz.hit_test.mojom; |
+ |
+import "cc/ipc/surface_id.mojom"; |
+import "ui/gfx/geometry/mojo/geometry.mojom"; |
+import "ui/gfx/mojo/transform.mojom"; |
+ |
+// Region maps to this surface ( me ). |
+const uint32 kHitTestMine = 0x01; |
+ |
+// Region ignored for hit testing ( transparent backgrounds & hover:none ). |
+const uint32 kHitTestIgnore = 0x02; |
+ |
+// Region maps to child surface ( OOPIF ). |
+const uint32 kHitTestChildSurface = 0x04; |
+ |
+// Irregular boundary - send HitTestRequest to resolve. |
+const uint32 kHitTestAsk = 0x08; |
+ |
+// No touch event handler exists - no need to send touch events. |
+const uint32 kHitTestNoTouchEventHandler = 0x10; |
sadrul
2017/06/27 04:23:35
As mentioned in https://codereview.chromium.org/29
gklassen
2017/06/27 21:46:33
Hmmm... I reviewed this implementation in detail,
|
+ |
+struct HitTestRegion { |
+ |
sadrul
2017/06/27 04:23:35
no blank line.
gklassen
2017/06/27 21:46:33
Done.
|
+ // Flags to indicate the type of HitTestRegion. |
+ uint32 flags; |
+ |
+ // SurfaceId is required when flags = kHitTestChildSurface. |
+ cc.mojom.SurfaceId surface_id; |
+ |
+ // The rect of the region in the coordinate space of the embedder. |
+ gfx.mojom.Rect rect; |
+ |
+ // The transform applied to the child region. |
sadrul
2017/06/27 04:23:35
What is 'child region'? (https://codereview.chromi
gklassen
2017/06/27 21:46:33
Done.
|
+ gfx.mojom.Transform transform; |
+}; |
+ |
+struct HitTestData { |
+ |
sadrul
2017/06/27 04:23:35
ditto
gklassen
2017/06/27 21:46:33
Done.
|
+ // SurfaceId corresponding to this HitTestData. |
+ cc.mojom.SurfaceId surface_id; |
+ |
+ // Flags indicate how to handle events that match no sub-regions. |
+ // kHitTestMine routes un-matched events to this surface ( opaque ). |
+ // kHitTestIgnore keeps previous match in the parent ( transparent ). |
+ uint32 flags; |
+ |
+ // The bounds of the surface. |
+ gfx.mojom.Rect bounds; |
+ |
+ // The transform that applies to all regions in this surface. |
+ gfx.mojom.Transform transform; |
+ |
+ // The list of sub-regions in front to back order. |
+ // TODO(gklassen): invert order if it's easier to write them back to front. |
+ array<HitTestRegion> regions; |
sadrul
2017/06/27 04:23:35
As mentioned in Ria's CL, I think I would go with
gklassen
2017/06/27 21:46:33
Agreed that neither is clearly a list of the other
sadrul
2017/06/28 05:27:40
I think the distinction between the two that matte
gklassen
2017/06/28 16:29:59
Done.
|
+}; |