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 "ui/gfx/geometry/quad_f.h" |
| 18 |
| 19 namespace viz { |
| 20 |
| 21 // DiplayHitTestData contains the hit_test data for the Display. |
| 22 // |
| 23 // It is designed to be in shared memory so that the viz process can |
| 24 // write the hit_test data, and the browser / ws process can read without |
| 25 // process hops. |
| 26 // |
| 27 // One instance of this class contains a double buffer of entries - |
| 28 // the viz process will write into one half while client processes read from |
| 29 // the other. read_offset_ is used to swap buffers atomically. |
| 30 |
| 31 // A DisplayHitTestRegion element with child_count of kEndOfList indicates |
| 32 // the last element ( end of the list ). |
| 33 constexpr int kEndOfList = -1; |
| 34 |
| 35 // A read_offset_ set to kOldPleaseReAcquire indicates that the buffer has been |
| 36 // resized and clients should re-acquire their reference. |
| 37 constexpr int kOldPleaseReAcquire = -1; |
| 38 |
| 39 struct DisplayHitTestRegion { |
| 40 cc::FrameSinkId frame_sink_id; |
| 41 uint32_t flags; |
| 42 gfx::Rect rect; |
| 43 gfx::Transform transform; |
| 44 int child_count; |
| 45 }; |
| 46 |
| 47 struct DisplayHitTestData { |
| 48 int length; |
| 49 base::subtle::Atomic32 read_offset; |
| 50 DisplayHitTestRegion regions[]; |
| 51 }; |
| 52 |
| 53 } // namespace viz |
| 54 |
| 55 #endif // COMPONENTS_VIZ_HIT_TEST_HIT_TEST_DATA_H_ |
OLD | NEW |