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 the viz process can |
| 25 // write the hit_test data, and the browser / ws process can read without |
| 26 // process hops. |
| 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. read_offset_ is used to swap buffers atomically. |
| 31 |
| 32 // A DisplayHitTestRegion element with child_count_ of kEndOfList indicates |
| 33 // the last element ( end of the list ). |
| 34 constexpr int kEndOfList = -1; |
| 35 |
| 36 // A read_offset_ set to kOldPleaseReAcquire indicates that the buffer has been |
| 37 // resized and clients should re-acquire their reference. |
| 38 constexpr int kOldPleaseReAcquire = -1; |
| 39 |
| 40 struct DisplayHitTestRegion { |
| 41 cc::FrameSinkId frame_sink_id_; |
| 42 hit_test::mojom::HitTestRegionFlags flags_; |
| 43 gfx::Rect rect_; |
| 44 gfx::Transform transform_; |
| 45 int child_count_; |
| 46 }; |
| 47 |
| 48 struct DisplayHitTestData { |
| 49 int length_; |
| 50 base::subtle::Atomic32 read_offset_; |
| 51 DisplayHitTestRegion regions_[]; |
| 52 }; |
| 53 |
| 54 } // namespace viz |
| 55 |
| 56 #endif // COMPONENTS_VIZ_HIT_TEST_HIT_TEST_DATA_H_ |
OLD | NEW |