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_COMMON_HIT_TEST_DISPLAY_HIT_TEST_DATA_H_ | |
6 #define COMPONENTS_VIZ_COMMON_HIT_TEST_DISPLAY_HIT_TEST_DATA_H_ | |
7 | |
8 #include <stdint.h> | |
9 | |
10 #include "cc/surfaces/surface_id.h" | |
11 #include "services/viz/hit_test/public/interfaces/hit_test_data.mojom.h" | |
12 | |
13 namespace viz { | |
14 | |
15 // DiplayHitTestData contains the aggregated hit-test data for the Display. | |
16 // | |
17 // It is designed to be in shared memory so that the viz process can | |
18 // write the hit_test data, and the browser / ws process can read without | |
19 // process hops. | |
20 // | |
21 // One instance of this class contains a double buffer of entries - | |
22 // the viz process will write into one half while client processes read from | |
23 // the other. read_offset is used to swap buffers atomically. | |
24 | |
25 // A DisplayHitTestRegion element with child_count of kEndOfList indicates | |
26 // the last element ( end of the list ). | |
27 constexpr int kEndOfList = -1; | |
28 | |
29 // A read_offset set to kOldPleaseReAcquire indicates that the buffer has been | |
30 // resized and clients should re-acquire their reference. | |
31 constexpr int kOldPleaseReAcquire = -1; | |
32 | |
33 struct DisplayHitTestRegion { | |
34 // The frame_sink_id corresponding to this region. Events that match | |
varkha
2017/06/20 19:56:58
nit: s/frame_sink_id/cc::FrameSinkId
gklassen
2017/06/26 21:55:19
Done.
| |
35 // are routed to this surface. | |
36 cc::FrameSinkId frame_sink_id; | |
37 | |
38 // Flags to indicate the type of region as defined in | |
39 // services/viz/hit_test/public/interfaces/hit_test_data.mojom.h. | |
40 uint32_t flags; | |
41 | |
42 // The rectangle that defines the region. | |
43 gfx::Rect rect; | |
44 | |
45 // The transform applied to the rect. | |
46 gfx::Transform transform; | |
47 | |
48 // The number of children ( including their children ) below this entry. | |
49 // If this element is not matched then child_count elements can be skipped | |
50 // to move to the next entry. | |
51 int child_count; | |
52 }; | |
53 | |
54 struct DisplayHitTestData { | |
55 int length; | |
56 base::subtle::Atomic32 read_offset; | |
57 DisplayHitTestRegion regions[]; | |
58 }; | |
59 | |
60 } // namespace viz | |
61 | |
62 #endif // COMPONENTS_VIZ_COMMON_HIT_TEST_DISPLAY_HIT_TEST_DATA_H_ | |
OLD | NEW |