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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: components/viz/hit_test/display_hit_test_data.h
diff --git a/components/viz/hit_test/display_hit_test_data.h b/components/viz/hit_test/display_hit_test_data.h
new file mode 100644
index 0000000000000000000000000000000000000000..34694ac38484095c17db4297323478e83ced2669
--- /dev/null
+++ b/components/viz/hit_test/display_hit_test_data.h
@@ -0,0 +1,55 @@
+// 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_HIT_TEST_HIT_TEST_DATA_H_
+#define COMPONENTS_VIZ_HIT_TEST_HIT_TEST_DATA_H_
+
+#include <stdint.h>
+
+#include <map>
+#include <memory>
+
+#include "cc/surfaces/surface_id.h"
+#include "cc/surfaces/surface_observer.h"
+#include "components/viz/hit_test/hit_test_export.h"
+#include "components/viz/hit_test/public/interfaces/hit_test_data.mojom.h"
+#include "ui/gfx/geometry/quad_f.h"
+
+namespace viz {
+
+// DiplayHitTestData contains the 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;
+
+// A read_offset_ set to kOldPleaseReAcquire indicates that the buffer has been
+// resized and clients should re-acquire their reference.
+constexpr int kOldPleaseReAcquire = -1;
+
+struct DisplayHitTestRegion {
+ cc::FrameSinkId frame_sink_id;
+ uint32_t flags;
+ gfx::Rect rect;
+ gfx::Transform transform;
+ int child_count;
+};
+
+struct DisplayHitTestData {
+ int length;
+ base::subtle::Atomic32 read_offset;
+ DisplayHitTestRegion regions[];
+};
+
+} // namespace viz
+
+#endif // COMPONENTS_VIZ_HIT_TEST_HIT_TEST_DATA_H_

Powered by Google App Engine
This is Rietveld 408576698