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_DISPLAY_HIT_TEST_DATA_H_ | |
| 6 #define COMPONENTS_VIZ_HIT_TEST_DISPLAY_HIT_TEST_DATA_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <map> | |
|
rjkroege
2017/06/15 21:58:43
why?
gklassen
2017/06/16 21:49:38
Done.
| |
| 11 #include <memory> | |
|
rjkroege
2017/06/15 21:58:43
ditto?
gklassen
2017/06/16 21:49:38
Done.
| |
| 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 | |
| 18 namespace viz { | |
| 19 | |
| 20 // DiplayHitTestData contains the hit_test data for the Display. | |
| 21 // | |
| 22 // It is designed to be in shared memory so that the viz process can | |
| 23 // write the hit_test data, and the browser / ws process can read without | |
| 24 // process hops. | |
| 25 // | |
| 26 // One instance of this class contains a double buffer of entries - | |
| 27 // the viz process will write into one half while client processes read from | |
| 28 // the other. read_offset_ is used to swap buffers atomically. | |
|
rjkroege
2017/06/15 21:58:43
I think you need two buffers. I am not convinced t
gklassen
2017/06/16 21:49:38
It needs to be made secure regardless of which app
| |
| 29 | |
| 30 // A DisplayHitTestRegion element with child_count of kEndOfList indicates | |
| 31 // the last element ( end of the list ). | |
| 32 constexpr int kEndOfList = -1; | |
| 33 | |
| 34 // A read_offset_ set to kOldPleaseReAcquire indicates that the buffer has been | |
| 35 // resized and clients should re-acquire their reference. | |
| 36 constexpr int kOldPleaseReAcquire = -1; | |
| 37 | |
| 38 struct DisplayHitTestRegion { | |
| 39 cc::FrameSinkId frame_sink_id; | |
| 40 uint32_t flags; | |
| 41 gfx::Rect rect; | |
| 42 gfx::Transform transform; | |
| 43 int child_count; | |
| 44 }; | |
| 45 | |
| 46 struct DisplayHitTestData { | |
| 47 int length; | |
| 48 base::subtle::Atomic32 read_offset; | |
| 49 DisplayHitTestRegion regions[]; | |
| 50 }; | |
| 51 | |
| 52 } // namespace viz | |
| 53 | |
| 54 #endif // COMPONENTS_VIZ_HIT_TEST_DISPLAY_HIT_TEST_DATA_H_ | |
| OLD | NEW |