Chromium Code Reviews| Index: components/viz/hit_test/display_hit_test_data.h |
| diff --git a/components/viz/hit_test/display_hit_test_data.h b/components/viz/hit_test/display_hit_test_data.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..24ef05a6b12d12fed5c4b60677eb309b423aae62 |
| --- /dev/null |
| +++ b/components/viz/hit_test/display_hit_test_data.h |
| @@ -0,0 +1,51 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_VIZ_HIT_TEST_HIT_TEST_DATA_H_ |
| +#define COMPONENTS_VIZ_HIT_TEST_HIT_TEST_DATA_H_ |
| + |
| +#include <stdint.h> |
| + |
| +#include <map> |
| +#include <memory> |
| + |
| +#include "cc/surfaces/surface_id.h" |
| +#include "cc/surfaces/surface_observer.h" |
| +#include "components/viz/hit_test/hit_test_export.h" |
| +#include "components/viz/hit_test/public/interfaces/hit_test_data.mojom.h" |
| +#include "hit_test_aggregator.h" |
| +#include "ui/gfx/geometry/quad_f.h" |
| + |
| +namespace viz { |
| + |
| +// DiplayHitTestData contains the hit_test data for the Display. |
| +// |
| +// It is designed to be in shared memory so that the viz process can |
| +// write the hit_test data, and other processes can read without |
|
rjkroege
2017/06/09 15:47:08
nit: only one process. The browser / ws.
gklassen
2017/06/12 16:30:41
A very welcome nit. Thank you. Done.
|
| +// process hops. |
| +// |
| +// One instance of this class contains a double buffer of entries - |
|
rjkroege
2017/06/09 15:47:08
there is a need to add a TODO about setting up the
gklassen
2017/06/12 16:30:41
Added by abstracting allocation on your suggestion
|
| +// the viz process will write into one half while client processes read from |
| +// the other. read_offset_ is used to swap buffers atomically. |
| + |
| +// the child_count_ of the last region in the list is set to |
| +constexpr int kEndOfList = -1; |
| + |
| +struct DisplayHitTestRegion { |
| + cc::FrameSinkId frame_sink_id_; |
| + hit_test::mojom::HitTestRegionFlags flags_; |
| + gfx::Rect rect_; |
| + gfx::Transform transform_; |
| + int child_count_; |
| +}; |
| + |
| +struct DisplayHitTestData { |
| + int size_; |
| + base::subtle::Atomic32 read_offset_; |
|
rjkroege
2017/06/09 15:47:07
this is communication from a less-trusted process
gklassen
2017/06/12 16:30:41
Acknowledged.
|
| + DisplayHitTestRegion regions_[]; |
| +}; |
| + |
| +} // namespace viz |
| + |
| +#endif // COMPONENTS_VIZ_HIT_TEST_HIT_TEST_DATA_H_ |