Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: components/viz/hit_test/display_hit_test_data.h

Issue 2908783002: WIP Hittest Component.
Patch Set: change HitTestFlags to constants so we can mix and match and convert to struct naming convention Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698