OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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 #ifndef COMPONENTS_VIZ_HIT_TEST_QUERY_HIT_TEST_QUERY_H_ | |
6 #define COMPONENTS_VIZ_HIT_TEST_QUERY_HIT_TEST_QUERY_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/macros.h" | |
11 #include "components/viz/hit_test/common/display_hit_test_data.h" | |
12 #include "components/viz/hit_test/hit_test_export.h" | |
13 #include "ui/gfx/geometry/point.h" | |
14 | |
15 namespace viz { | |
16 namespace hit_test { | |
17 | |
18 struct Target { | |
19 cc::FrameSinkId id; | |
20 gfx::Point location_in_target; | |
21 // TODO(riajiang): use HitTestRegionFlags instead of int after | |
22 // https://codereview.chromium.org/2908783002/ | |
23 int flags; | |
24 }; | |
25 | |
26 // Finds the target for a given location based on DisplayHitTestData aggreated | |
27 // by HitTestComponent. | |
28 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
| |
29 public: | |
30 HitTestQuery(); | |
31 ~HitTestQuery(); | |
32 | |
33 // TODO(riajiang): Read from shmem directly once it's set up. For now, use | |
34 // fake data. | |
35 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
| |
36 std::vector<DisplayHitTestData> display_hit_test_data_list) { | |
37 display_hit_test_data_list_ = display_hit_test_data_list; | |
38 } | |
39 | |
40 // Find Target for |location_in_root|, including the FrameSinkId of the | |
41 // target, updated location in the coordinate system of the target and | |
42 // hit-test flags for the target. | |
43 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
| |
44 | |
45 private: | |
46 std::vector<DisplayHitTestData> display_hit_test_data_list_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(HitTestQuery); | |
49 }; | |
50 | |
51 } // namespace hit_test | |
52 } // namespace viz | |
53 | |
54 #endif // COMPONENTS_VIZ_HIT_TEST_QUERY_HIT_TEST_QUERY_H_ | |
OLD | NEW |