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

Side by Side Diff: components/viz/hittest/hittest_aggregator.cc

Issue 2908783002: WIP Hittest Component.
Patch Set: surface observer and test setup 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/viz/hittest/hittest_aggregator.h"
6 #include "base/logging.h"
7
8 namespace viz {
9
10 namespace {
11
12 #define INITIAL_COUNT 128
13 }
14
15 HittestAggregator::HittestAggregator() {
16 regions_[0] = (Element*)malloc(INITIAL_COUNT * sizeof(Element));
rjkroege 2017/06/02 22:45:45 this is most certainly not how you want to do it i
17 regions_[1] = (Element*)malloc(INITIAL_COUNT * sizeof(Element));
18 regions_[0][0].child_count_ = LAST_REGION;
19 regions_[1][0].child_count_ = LAST_REGION;
20
21 current_regions_ = regions_[0];
22 }
23 HittestAggregator::~HittestAggregator() {}
24
25 cc::SurfaceId HittestAggregator::SurfaceIdAtPoint(
26 cc::SurfaceId root_surface_id,
27 const gfx::Point& point,
28 gfx::Point* transformed_point) {
29 return root_surface_id;
rjkroege 2017/06/02 22:45:45 that's not right.
30 }
31
32 void HittestAggregator::SubmitHittestData(
33 hittest::mojom::HittestDataPtr hittest_data) {
34 pending_[hittest_data->surface_id_] = std::move(hittest_data);
rjkroege 2017/06/02 22:45:45 not sufficient. one surface may have multiple hitt
gklassen 2017/06/05 21:32:14 I'd like to understand this better. If there are
35 }
36
37 void HittestAggregator::Aggregate(cc::SurfaceId display_surface_id) {}
38
39 void HittestAggregator::swap() {
rjkroege 2017/06/02 22:45:45 how is this connected up to BeginFrame?
40 if (current_regions_ == regions_[0]) {
41 current_regions_ = regions_[1];
42 } else {
43 current_regions_ = regions_[0];
44 }
45 }
46
47 void HittestAggregator::OnSurfaceDiscarded(const cc::SurfaceId& surface_id) {
48 pending_.erase(surface_id);
49 active_.erase(surface_id);
50 }
51 void HittestAggregator::OnSurfaceWillDraw(const cc::SurfaceId& surface_id) {
52 active_[surface_id] = std::move(pending_[surface_id]);
53 }
54
55 } // namespace viz
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698