Index: components/viz/hit_test/query/hit_test_query.h |
diff --git a/components/viz/hit_test/query/hit_test_query.h b/components/viz/hit_test/query/hit_test_query.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..69d669f5a0ac596953ed099403211c0cc6363453 |
--- /dev/null |
+++ b/components/viz/hit_test/query/hit_test_query.h |
@@ -0,0 +1,54 @@ |
+// 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. |
+ |
+#ifndef COMPONENTS_VIZ_HIT_TEST_QUERY_HIT_TEST_QUERY_H_ |
+#define COMPONENTS_VIZ_HIT_TEST_QUERY_HIT_TEST_QUERY_H_ |
+ |
+#include <vector> |
+ |
+#include "base/macros.h" |
+#include "components/viz/hit_test/common/display_hit_test_data.h" |
+#include "components/viz/hit_test/hit_test_export.h" |
+#include "ui/gfx/geometry/point.h" |
+ |
+namespace viz { |
+namespace hit_test { |
+ |
+struct Target { |
+ cc::FrameSinkId id; |
+ gfx::Point location_in_target; |
+ // TODO(riajiang): use HitTestRegionFlags instead of int after |
+ // https://codereview.chromium.org/2908783002/ |
+ int flags; |
+}; |
+ |
+// Finds the target for a given location based on DisplayHitTestData aggreated |
+// by HitTestComponent. |
+class HIT_TEST_EXPORT HitTestQuery { |
rjkroege
2017/06/12 17:17:24
this needs eventually to dangle off of GpuHost. An
riajiang
2017/06/13 18:42:29
Should GpuHost be the one that creates both the sh
|
+ public: |
+ HitTestQuery(); |
+ ~HitTestQuery(); |
+ |
+ // TODO(riajiang): Read from shmem directly once it's set up. For now, use |
+ // fake data. |
+ void set_display_hit_test_data_list( |
rjkroege
2017/06/12 17:17:24
this is fakery that will go away?
riajiang
2017/06/13 18:42:29
Yes. Once shmem is set up, we'll just read from th
|
+ std::vector<DisplayHitTestData> display_hit_test_data_list) { |
+ display_hit_test_data_list_ = display_hit_test_data_list; |
+ } |
+ |
+ // Find Target for |location_in_root|, including the FrameSinkId of the |
+ // target, updated location in the coordinate system of the target and |
+ // hit-test flags for the target. |
+ Target FindTargetForLocation(const gfx::Point& location_in_root); |
rjkroege
2017/06/12 17:17:24
I may quibble at you about passing Target instance
riajiang
2017/06/13 18:42:30
True! They are not going to be mutable, changing t
|
+ |
+ private: |
+ std::vector<DisplayHitTestData> display_hit_test_data_list_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(HitTestQuery); |
+}; |
+ |
+} // namespace hit_test |
+} // namespace viz |
+ |
+#endif // COMPONENTS_VIZ_HIT_TEST_QUERY_HIT_TEST_QUERY_H_ |