Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |