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

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

Issue 2933493003: Add viz-host HitTestQuery. (Closed)
Patch Set: comment #6 #7 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 "ui/gfx/geometry/point.h"
13
14 namespace viz {
15 namespace hit_test {
16
17 struct Target {
18 cc::FrameSinkId id;
19 // |location_in_target| is in the coordinate system of the target FrameSinkId.
20 gfx::Point location_in_target;
21 uint32_t flags;
sadrul 2017/06/16 17:09:51 Add a comment to point to where the flags are defi
riajiang 2017/06/23 02:46:37 Done.
22 };
23
24 // Finds the target for a given location based on DisplayHitTestData aggreated
25 // by HitTestComponent.
26 class HitTestQuery {
27 public:
28 HitTestQuery();
29 ~HitTestQuery();
30
31 // TODO(riajiang): Read from shmem directly once it's set up and delete this
32 // function. For now, use fake data.
33 void set_display_hit_test_data_list(
34 DisplayHitTestData display_hit_test_data_list) {
35 display_hit_test_data_list_ = display_hit_test_data_list;
sadrul 2017/06/16 17:09:51 Use std::move
riajiang 2017/06/23 02:46:36 Done.
36 }
37
38 // Find Target for |location_in_root|, including the FrameSinkId of the
39 // target, updated location in the coordinate system of the target and
40 // hit-test flags for the target.
41 Target FindTargetForLocation(const gfx::Point& location_in_root);
42
43 private:
44 DisplayHitTestData display_hit_test_data_list_;
45
46 DISALLOW_COPY_AND_ASSIGN(HitTestQuery);
47 };
48
49 } // namespace hit_test
50 } // namespace viz
51
52 #endif // COMPONENTS_VIZ_HOST_HIT_TEST_HIT_TEST_QUERY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698