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

Unified Diff: components/viz/common/hit_test/display_hit_test_data.h

Issue 2938953002: Implement HitTestAggregator (Closed)
Patch Set: Use Shared Memory handles and mappings to manage buffers & other improvements based on reviewer com… 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 side-by-side diff with in-line comments
Download patch
Index: components/viz/common/hit_test/display_hit_test_data.h
diff --git a/components/viz/common/hit_test/display_hit_test_data.h b/components/viz/common/hit_test/display_hit_test_data.h
new file mode 100644
index 0000000000000000000000000000000000000000..174ac08de1487c0ff2af96f5f2b9dff88edb9d79
--- /dev/null
+++ b/components/viz/common/hit_test/display_hit_test_data.h
@@ -0,0 +1,53 @@
+// 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_COMMON_HIT_TEST_DISPLAY_HIT_TEST_DATA_H_
+#define COMPONENTS_VIZ_COMMON_HIT_TEST_DISPLAY_HIT_TEST_DATA_H_
+
+#include <stdint.h>
+
+#include "cc/surfaces/surface_id.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/transform.h"
+
+namespace viz {
+
+// DiplayHitTestData contains the aggregated 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 the browser / ws process can read without
+// process hops.
+//
+// One instance of this class contains a double buffer of entries -
+// the viz process will write into one half while client processes read from
+// the other. read_offset is used to swap buffers atomically.
+
+// A DisplayHitTestRegion element with child_count of kEndOfList indicates
+// the last element ( end of the list ).
+constexpr int kEndOfList = -1;
+
+struct DisplayHitTestRegion {
+ // The cc::FrameSinkId corresponding to this region. Events that match
+ // are routed to this surface.
+ cc::FrameSinkId frame_sink_id;
+
+ // Flags to indicate the type of region as defined in
+ // services/viz/hit_test/public/interfaces/hit_test_data.mojom.h.
+ uint32_t flags;
+
+ // The rectangle that defines the region.
sadrul 2017/06/27 04:23:34 In the parent region's coordinate space, I guess?
gklassen 2017/06/27 21:46:33 Done.
+ gfx::Rect rect;
+
+ // The transform applied to the rect.
sadrul 2017/06/27 04:23:34 ditto
gklassen 2017/06/27 21:46:33 Done.
+ gfx::Transform transform;
+
+ // The number of children ( including their children ) below this entry.
sadrul 2017/06/27 04:23:34 no space after ( or before ) (applies to other pla
gklassen 2017/06/27 21:46:33 Done.
+ // If this element is not matched then child_count elements can be skipped
+ // to move to the next entry.
+ int child_count;
+};
+
+} // namespace viz
+
+#endif // COMPONENTS_VIZ_COMMON_HIT_TEST_DISPLAY_HIT_TEST_DATA_H_

Powered by Google App Engine
This is Rietveld 408576698