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 #ifndef COMPONENTS_VIZ_HITTEST_HITTEST_AGGREGATOR_H_ | |
| 6 #define COMPONENTS_VIZ_HITTEST_HITTEST_AGGREGATOR_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <map> | |
| 11 #include <memory> | |
| 12 | |
| 13 #include "cc/surfaces/surface_id.h" | |
| 14 #include "cc/surfaces/surface_observer.h" | |
| 15 #include "components/viz/hittest/hittest_export.h" | |
| 16 #include "components/viz/hittest/public/interfaces/hittest_data.mojom.h" | |
| 17 #include "ui/gfx/geometry/quad_f.h" | |
| 18 | |
| 19 namespace viz { | |
| 20 | |
| 21 namespace test { | |
| 22 class HittestAggregatorTest; | |
| 23 } | |
| 24 | |
| 25 class DisplayHittestData; | |
| 26 | |
| 27 // Hittest maintains maping between display regions and associated surfaces | |
| 28 // in shared memory to enable efficient hit testing across processes. | |
| 29 // | |
| 30 // This is intended to be created in the viz or GPU process. For mus+ash this | |
| 31 // will be true after the mus process split. | |
| 32 | |
| 33 typedef std::map<cc::SurfaceId, hittest::mojom::HittestDataPtr> HittestDataMap; | |
|
rjkroege
2017/06/07 17:16:45
use using
gklassen
2017/06/07 20:04:44
the compiler reports "error: using declaration can
rjkroege
2017/06/07 20:22:56
This doesn't compile?
using HittestDataMap = std:
gklassen
2017/06/08 17:09:22
( gklassen@ would like to recall this statement on
| |
| 34 | |
| 35 class HITTEST_EXPORT HittestAggregator : public cc::SurfaceObserver { | |
| 36 friend class test::HittestAggregatorTest; | |
|
rjkroege
2017/06/07 17:16:45
grumble.
gklassen
2017/06/07 20:04:44
Suggestions welcome. The test code requires acces
rjkroege
2017/06/07 20:22:56
https://cs.chromium.org/chromium/src/base/gtest_pr
gklassen
2017/06/08 17:09:22
This seems to require a MACRO per method and a fri
| |
| 37 | |
| 38 public: | |
| 39 HittestAggregator(); | |
| 40 ~HittestAggregator(); | |
| 41 | |
| 42 cc::SurfaceId SurfaceIdAtPoint(cc::SurfaceId root_surface_id, | |
|
rjkroege
2017/06/07 17:16:45
Method comments please
gklassen
2017/06/07 20:04:44
Done.
| |
| 43 const gfx::Point& point, | |
| 44 gfx::Point* transformed_point); | |
| 45 void SubmitHittestData(hittest::mojom::HittestDataPtr hittest_data); | |
| 46 void Aggregate(cc::SurfaceId display_surface_id); | |
| 47 | |
| 48 // SurfaceObserver | |
| 49 void OnSurfaceCreated(const cc::SurfaceInfo& surface_info) override {} | |
| 50 void OnSurfaceDestroyed(const cc::SurfaceId& surface_id) override {} | |
| 51 void OnSurfaceDamaged(const cc::SurfaceId& surface_id, | |
| 52 const cc::BeginFrameAck& ack, | |
| 53 bool* changed) override {} | |
| 54 void OnSurfaceDiscarded(const cc::SurfaceId& surface_id) override; | |
| 55 void OnSurfaceDamageExpected(const cc::SurfaceId& surface_id, | |
| 56 const cc::BeginFrameArgs& args) override {} | |
| 57 void OnSurfaceWillDraw(const cc::SurfaceId& surface_id) override; | |
| 58 | |
| 59 private: | |
| 60 HittestDataMap pending_; | |
| 61 HittestDataMap active_; | |
| 62 | |
| 63 DisplayHittestData* display_hittest_data_; | |
| 64 | |
| 65 void swap(); | |
| 66 }; | |
| 67 | |
| 68 } // namespace viz | |
| 69 | |
| 70 #endif // COMPONENTS_VIZ_HITTEST_HITTEST_AGGREGATOR_H_ | |
| OLD | NEW |