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

Side by Side Diff: components/viz/common/hit_test/aggregated_hit_test_region.h

Issue 2933493003: Add viz-host HitTestQuery. (Closed)
Patch Set: don't combine uint and int; check for overflow Created 3 years, 5 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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_VIZ_COMMON_HIT_TEST_AGGREGATED_HIT_TEST_REGION_H_ 5 #ifndef COMPONENTS_VIZ_COMMON_HIT_TEST_AGGREGATED_HIT_TEST_REGION_H_
6 #define COMPONENTS_VIZ_COMMON_HIT_TEST_AGGREGATED_HIT_TEST_REGION_H_ 6 #define COMPONENTS_VIZ_COMMON_HIT_TEST_AGGREGATED_HIT_TEST_REGION_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "components/viz/common/surfaces/surface_id.h" 10 #include "components/viz/common/surfaces/surface_id.h"
11 #include "ui/gfx/geometry/rect.h" 11 #include "ui/gfx/geometry/rect.h"
12 #include "ui/gfx/transform.h" 12 #include "ui/gfx/transform.h"
13 13
14 namespace viz { 14 namespace viz {
15 15
16 // A AggregatedHitTestRegion element with child_count of kEndOfList indicates 16 // A AggregatedHitTestRegion element with child_count of kEndOfList indicates
17 // the last element and end of the list. 17 // the last element and end of the list.
18 constexpr int kEndOfList = -1; 18 constexpr int32_t kEndOfList = -1;
19 19
20 // An array of AggregatedHitTestRegion elements is used to define the 20 // An array of AggregatedHitTestRegion elements is used to define the
21 // aggregated hit-test data for the Display. 21 // aggregated hit-test data for the Display.
22 // 22 //
23 // It is designed to be in shared memory so that the viz service can 23 // It is designed to be in shared memory so that the viz service can
24 // write the hit_test data, and the viz host can read without 24 // write the hit_test data, and the viz host can read without
25 // process hops. 25 // process hops.
26 struct AggregatedHitTestRegion { 26 struct AggregatedHitTestRegion {
27 // The FrameSinkId corresponding to this region. Events that match 27 // The FrameSinkId corresponding to this region. Events that match
28 // are routed to this surface. 28 // are routed to this surface.
29 FrameSinkId frame_sink_id; 29 FrameSinkId frame_sink_id;
30 30
31 // Flags to indicate the type of region as defined for 31 // Flags to indicate the type of region as defined for
32 // mojom::HitTestRegion 32 // mojom::HitTestRegion
33 uint32_t flags; 33 uint32_t flags;
34 34
35 // The rectangle that defines the region in parent region's coordinate space. 35 // The rectangle that defines the region in parent region's coordinate space.
36 gfx::Rect rect; 36 gfx::Rect rect;
37 37
38 // The transform applied to the rect in parent region's coordinate space. 38 // The transform applied to the rect in parent region's coordinate space.
39 gfx::Transform transform; 39 gfx::Transform transform;
40 40
41 // The number of children including their children below this entry. 41 // The number of children including their children below this entry.
42 // If this element is not matched then child_count elements can be skipped 42 // If this element is not matched then child_count elements can be skipped
43 // to move to the next entry. 43 // to move to the next entry.
44 int child_count; 44 int32_t child_count;
45 }; 45 };
46 46
47 } // namespace viz 47 } // namespace viz
48 48
49 #endif // COMPONENTS_VIZ_COMMON_HIT_TEST_AGGREGATED_HIT_TEST_REGION_H_ 49 #endif // COMPONENTS_VIZ_COMMON_HIT_TEST_AGGREGATED_HIT_TEST_REGION_H_
OLDNEW
« no previous file with comments | « no previous file | components/viz/host/BUILD.gn » ('j') | components/viz/service/hit_test/hit_test_aggregator_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698