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

Side by Side Diff: components/viz/host/hit_test/hit_test_query.h

Issue 2933493003: Add viz-host HitTestQuery. (Closed)
Patch Set: update Created 3 years, 6 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 unified diff | Download patch
OLDNEW
(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_HOST_HIT_TEST_HIT_TEST_QUERY_H_
6 #define COMPONENTS_VIZ_HOST_HIT_TEST_HIT_TEST_QUERY_H_
7
8 #include <vector>
9
10 #include "base/macros.h"
11 #include "components/viz/common/hit_test/display_hit_test_data.h"
12 #include "components/viz/common/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;
rjkroege 2017/06/15 19:58:36 the coordinate system of the target FrameSinkId...
riajiang 2017/06/16 02:56:54 Done.
21 // TODO(riajiang): use HitTestRegionFlags instead of int after
22 // https://codereview.chromium.org/2908783002/
23 int flags;
gklassen 2017/06/15 19:51:20 flags are now a uint32 instead of HitTesRegionFlag
riajiang 2017/06/16 02:56:54 Ah I see, changed to uint32.
24 };
25
26 // Finds the target for a given location based on DisplayHitTestData aggreated
27 // by HitTestComponent.
28 class HIT_TEST_EXPORT HitTestQuery {
29 public:
30 HitTestQuery();
31 ~HitTestQuery();
32
33 // TODO(riajiang): Read from shmem directly once it's set up and delete this
34 // function. For now, use fake data.
35 void set_display_hit_test_data_list(
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/15 19:58:36 You have written the code that does the event disp
riajiang 2017/06/16 02:56:54 https://cs.chromium.org/chromium/src/services/ui/w
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_HOST_HIT_TEST_HIT_TEST_QUERY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698