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 "cc/surfaces/surface_observer.h" | |
varkha
2017/06/19 21:15:04
Is this header necessary?
gklassen
2017/06/20 16:09:38
No, you're right, it isn't. Done.
| |
12 #include "services/viz/hit_test/public/interfaces/hit_test_data.mojom.h" | |
varkha
2017/06/19 21:15:04
Ditto.
gklassen
2017/06/20 16:09:37
This one is necessary. It pulls in the constants
varkha
2017/06/20 19:56:58
Not sure about the style with mojo. Do we usually
gklassen
2017/06/26 21:55:19
Done.
| |
13 | |
14 namespace viz { | |
15 | |
16 // DiplayHitTestData contains the hit_test data for the Display. | |
varkha
2017/06/19 21:15:03
nit: introduce hit_test? Or did you mean hit-test
gklassen
2017/06/20 16:09:38
Done.
| |
17 // | |
18 // It is designed to be in shared memory so that the viz process can | |
19 // write the hit_test data, and the browser / ws process can read without | |
20 // process hops. | |
21 // | |
22 // One instance of this class contains a double buffer of entries - | |
23 // the viz process will write into one half while client processes read from | |
24 // the other. read_offset_ is used to swap buffers atomically. | |
varkha
2017/06/19 21:15:03
nit: s/read_offset_/|read_offset|
gklassen
2017/06/20 16:09:37
Done.
| |
25 | |
26 // A DisplayHitTestRegion element with child_count of kEndOfList indicates | |
27 // the last element ( end of the list ). | |
28 constexpr int kEndOfList = -1; | |
29 | |
30 // A read_offset_ set to kOldPleaseReAcquire indicates that the buffer has been | |
varkha
2017/06/19 21:15:04
nit: s/read_offset_/|read_offset|
gklassen
2017/06/20 16:09:37
Done.
| |
31 // resized and clients should re-acquire their reference. | |
32 constexpr int kOldPleaseReAcquire = -1; | |
33 | |
34 struct DisplayHitTestRegion { | |
35 cc::FrameSinkId frame_sink_id; | |
varkha
2017/06/19 21:15:04
Needs cc/surfaces/frame_sink_id.h ?
gklassen
2017/06/20 16:09:37
These are pulled in with the mojom reference and d
gklassen
2017/06/26 21:55:19
Done.
| |
36 uint32_t flags; | |
37 gfx::Rect rect; | |
varkha
2017/06/19 21:15:04
does this need a header?
gklassen
2017/06/26 21:55:18
Done.
| |
38 gfx::Transform transform; | |
varkha
2017/06/19 21:15:03
Ditto.
gklassen
2017/06/26 21:55:19
Done.
| |
39 int child_count; | |
40 }; | |
41 | |
42 struct DisplayHitTestData { | |
43 int length; | |
44 base::subtle::Atomic32 read_offset; | |
varkha
2017/06/19 21:15:03
Needs base/atomicops.h ?
gklassen
2017/06/20 16:09:37
This will need to change anyways - we will be chan
gklassen
2017/06/26 21:55:19
Done.
| |
45 DisplayHitTestRegion regions[]; | |
46 }; | |
47 | |
48 } // namespace viz | |
49 | |
50 #endif // COMPONENTS_VIZ_COMMON_HIT_TEST_DISPLAY_HIT_TEST_DATA_H_ | |
varkha
2017/06/19 21:15:04
nit: remove extra space after //
gklassen
2017/06/20 16:09:38
Done.
| |
OLD | NEW |