Chromium Code Reviews| 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_HIT_TEST_HIT_TEST_DATA_H_ | |
| 6 #define COMPONENTS_VIZ_HIT_TEST_HIT_TEST_DATA_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <map> | |
| 11 #include <memory> | |
| 12 | |
| 13 #include "cc/surfaces/surface_id.h" | |
| 14 #include "cc/surfaces/surface_observer.h" | |
| 15 #include "components/viz/hit_test/hit_test_export.h" | |
| 16 #include "components/viz/hit_test/public/interfaces/hit_test_data.mojom.h" | |
| 17 #include "hit_test_aggregator.h" | |
| 18 #include "ui/gfx/geometry/quad_f.h" | |
| 19 | |
| 20 namespace viz { | |
| 21 | |
| 22 // DiplayHitTestData contains the hit_test data for the Display. | |
| 23 // | |
| 24 // It is designed to be in shared memory so that | |
| 25 // - the viz process can collect and write the hit_test data, and | |
| 26 // - other processes can access without process hops or mojo calls | |
|
rjkroege
2017/06/07 21:19:04
sentences need periods
gklassen
2017/06/08 20:33:20
Done.
| |
| 27 // | |
| 28 // One instance of this class contains a double buffer of entries - | |
| 29 // the viz process will write into one half while client processes read from | |
| 30 // the other. front_offset_ is used to swap buffers atomically. | |
| 31 | |
| 32 // the child_count_ of the last region in the list is set to | |
| 33 constexpr int kEndOfList = -1; | |
| 34 | |
| 35 struct DisplayHitTestRegion { | |
| 36 cc::FrameSinkId frame_sink_id_; | |
| 37 hit_test::mojom::HitTestRegionFlags flags_; | |
| 38 gfx::Rect rect_; | |
| 39 gfx::Transform transform_; | |
| 40 int child_count_; | |
| 41 }; | |
| 42 | |
| 43 struct DisplayHitTestData { | |
| 44 int size_; | |
| 45 base::subtle::Atomic32 front_offset_; | |
|
rjkroege
2017/06/07 21:19:04
per my earlier blither... we could consider using
| |
| 46 DisplayHitTestRegion regions_[]; | |
|
rjkroege
2017/06/07 21:19:04
Some compilers don't like 0-length arrays. You mig
gklassen
2017/06/08 20:33:20
if it's a pointer then the struct won't be flat -
| |
| 47 }; | |
| 48 | |
| 49 } // namespace viz | |
| 50 | |
| 51 #endif // COMPONENTS_VIZ_HIT_TEST_HIT_TEST_DATA_H_ | |
| OLD | NEW |