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

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

Issue 2908783002: WIP Hittest Component.
Patch Set: format 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/hittest.cc
diff --git a/components/viz/hittest/hittest.cc b/components/viz/hittest/hittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..23ba574d5e4d71c2c8cd857611a839baebea3755
--- /dev/null
+++ b/components/viz/hittest/hittest.cc
@@ -0,0 +1,51 @@
+// 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.h"
+
+#include "base/logging.h"
+
+namespace viz {
+
+struct Hittest::Region {
rjkroege 2017/05/29 15:58:02 it's convention that stuff that never leaves the .
+ cc::SurfaceId surface_id;
+ gfx::QuadF quad;
+ unsigned int flags;
+ int nChildren;
+};
+
+Hittest* Hittest::instance_;
+
+Hittest::Hittest() {
+ current_regions_ = &regions_[0];
+}
+
+Hittest::~Hittest() {}
+
+cc::SurfaceId Hittest::InternalGetSurfaceIdAtPoint(
+ cc::SurfaceId root_surface_id,
+ const gfx::Point& point,
+ gfx::Point* transformed_point) {
+ return root_surface_id;
+}
+
+void Hittest::SubmitHittestData(
+ viz::hittest::mojom::HittestData& hittest_data) {
+ // add to pending
+}
+
+void Hittest::Aggregate() {
rjkroege 2017/05/29 15:58:02 I'd not have the empty entry point. Write the aggr
+ // todo: walk pending list and assemble into a _regions list
+ swap();
+}
+
+void Hittest::swap() {
+ if (current_regions_ == &regions_[0]) {
+ current_regions_ = &regions_[1];
+ } else {
+ current_regions_ = &regions_[0];
+ }
+}
+
+} // namespace viz

Powered by Google App Engine
This is Rietveld 408576698