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

Unified Diff: components/viz/hittest/display_hittest_data.h

Issue 2908783002: WIP Hittest Component.
Patch Set: surface observer and test setup Created 3 years, 7 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/hittest/display_hittest_data.h
diff --git a/components/viz/hittest/display_hittest_data.h b/components/viz/hittest/display_hittest_data.h
new file mode 100644
index 0000000000000000000000000000000000000000..1a09c804ad5add94ec7caf9230b300af06eff2e0
--- /dev/null
+++ b/components/viz/hittest/display_hittest_data.h
@@ -0,0 +1,61 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
rjkroege 2017/06/02 22:45:45 you need to set the Copyright date to 2017 here an
gklassen 2017/06/05 21:32:14 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_VIZ_HITTEST_HITTEST_AGGREGATOR_H_
+#define COMPONENTS_VIZ_HITTEST_HITTEST_AGGREGATOR_H_
+
+#include <stdint.h>
+
+#include <map>
+#include <memory>
+
+#include "cc/surfaces/surface_id.h"
+#include "cc/surfaces/surface_observer.h"
+#include "components/viz/hittest/hittest_export.h"
+#include "components/viz/hittest/public/interfaces/hittest_data.mojom.h"
+#include "ui/gfx/geometry/quad_f.h"
+
+namespace viz {
+
+namespace test {
+class HittestAggregatorTest;
+}
+
+// Hittest maintains maping between display regions and associated surfaces
+// in shared memory to enable efficient hit testing across processes.
+//
+// This is intended to be created in the viz or GPU process. For mus+ash this
rjkroege 2017/06/02 22:45:44 I'm not sure that the sandbox permits this. You ne
gklassen 2017/06/05 21:32:14 Thanks. Investigating and will have a proposal so
+// will be true after the mus process split.
+
+#define LAST_REGION -2
rjkroege 2017/06/02 22:45:45 enums are preferred.
gklassen 2017/06/05 21:32:14 Done.
+
+class HITTEST_EXPORT DisplayHittestData {
rjkroege 2017/06/02 22:45:44 This need to be a POD class.
gklassen 2017/06/05 21:32:13 Done.
+ friend class test::HittestAggregatorTest;
rjkroege 2017/06/02 22:45:44 this is conceivably but non ideal. do we have to h
+
+ public:
+ DisplayHittestData();
+ ~DisplayHittestData();
+
+ void build(HittestDataMap map, cc::SurfaceId root_surface_id);
rjkroege 2017/06/02 22:45:45 All public Chrome methods are capital letter first
gklassen 2017/06/05 21:32:13 Done.
+
+ private:
+ int append(HittestDataMap map, int index, cc::SurfaceId root_surface_id);
rjkroege 2017/06/02 22:45:44 Private methods that are not getters/setters are a
gklassen 2017/06/05 21:32:13 Done.
+
+ struct Element {
+ cc.mojom.SurfaceId surface_id_;
+ HittestRegionFlags flags_;
+ gfx.mojom.Rect rect_;
rjkroege 2017/06/02 22:45:44 these do not need to be serialized. You could just
gklassen 2017/06/05 21:32:13 Done.
+ gfx.mojom.Transform transform_;
+ int child_count_;
+ };
+
+ base::subtle::Atomic32 offset_;
rjkroege 2017/06/02 22:45:45 why? I see. You are treating this a bit like a co
+ int count_;
+ int size_;
+ Element regions_[];
rjkroege 2017/06/02 22:45:45 How are you sizing this? C++ is really very stupid
+};
+
+} // namespace viz
+
+#endif // COMPONENTS_VIZ_HITTEST_HITTEST_AGGREGATOR_H_

Powered by Google App Engine
This is Rietveld 408576698