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

Unified Diff: components/viz/hittest/hittest_aggregator.cc

Issue 2908783002: WIP Hittest Component.
Patch Set: improvements from reviewer comments 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/hittest/hittest_aggregator.cc
diff --git a/components/viz/hittest/hittest_aggregator.cc b/components/viz/hittest/hittest_aggregator.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c706538a5d8fa2ee26b0a784b05dc2b36dabad20
--- /dev/null
+++ b/components/viz/hittest/hittest_aggregator.cc
@@ -0,0 +1,38 @@
+// 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.
+
+#include "components/viz/hittest/hittest_aggregator.h"
+#include "base/logging.h"
+#include "display_hittest_data.h"
+
+namespace viz {
+
+HittestAggregator::HittestAggregator() {}
+HittestAggregator::~HittestAggregator() {}
+
+cc::SurfaceId HittestAggregator::SurfaceIdAtPoint(
+ cc::SurfaceId root_surface_id,
+ const gfx::Point& point,
+ gfx::Point* transformed_point) {
+ return root_surface_id;
+}
+
+void HittestAggregator::SubmitHittestData(
+ hittest::mojom::HittestDataPtr hittest_data) {
+ pending_[hittest_data->surface_id_] = std::move(hittest_data);
+}
+
+void HittestAggregator::Aggregate(cc::SurfaceId display_surface_id) {
+ display_hittest_data_->Build(active_, display_surface_id);
+}
+
+void HittestAggregator::OnSurfaceDiscarded(const cc::SurfaceId& surface_id) {
+ pending_.erase(surface_id);
+ active_.erase(surface_id);
+}
+void HittestAggregator::OnSurfaceWillDraw(const cc::SurfaceId& surface_id) {
+ active_[surface_id] = std::move(pending_[surface_id]);
+}
+
+} // namespace viz

Powered by Google App Engine
This is Rietveld 408576698