Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
|
rjkroege
2017/06/02 22:45:45
you need to set the Copyright date to 2017 here an
gklassen
2017/06/05 21:32:14
Done.
| |
| 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 // Hittest maintains maping between display regions and associated surfaces | |
| 26 // in shared memory to enable efficient hit testing across processes. | |
| 27 // | |
| 28 // This is intended to be created in the viz or GPU process. For mus+ash this | |
|
rjkroege
2017/06/02 22:45:44
I'm not sure that the sandbox permits this. You ne
gklassen
2017/06/05 21:32:14
Thanks. Investigating and will have a proposal so
| |
| 29 // will be true after the mus process split. | |
| 30 | |
| 31 #define LAST_REGION -2 | |
|
rjkroege
2017/06/02 22:45:45
enums are preferred.
gklassen
2017/06/05 21:32:14
Done.
| |
| 32 | |
| 33 class HITTEST_EXPORT DisplayHittestData { | |
|
rjkroege
2017/06/02 22:45:44
This need to be a POD class.
gklassen
2017/06/05 21:32:13
Done.
| |
| 34 friend class test::HittestAggregatorTest; | |
|
rjkroege
2017/06/02 22:45:44
this is conceivably but non ideal. do we have to h
| |
| 35 | |
| 36 public: | |
| 37 DisplayHittestData(); | |
| 38 ~DisplayHittestData(); | |
| 39 | |
| 40 void build(HittestDataMap map, cc::SurfaceId root_surface_id); | |
|
rjkroege
2017/06/02 22:45:45
All public Chrome methods are capital letter first
gklassen
2017/06/05 21:32:13
Done.
| |
| 41 | |
| 42 private: | |
| 43 int append(HittestDataMap map, int index, cc::SurfaceId root_surface_id); | |
|
rjkroege
2017/06/02 22:45:44
Private methods that are not getters/setters are a
gklassen
2017/06/05 21:32:13
Done.
| |
| 44 | |
| 45 struct Element { | |
| 46 cc.mojom.SurfaceId surface_id_; | |
| 47 HittestRegionFlags flags_; | |
| 48 gfx.mojom.Rect rect_; | |
|
rjkroege
2017/06/02 22:45:44
these do not need to be serialized. You could just
gklassen
2017/06/05 21:32:13
Done.
| |
| 49 gfx.mojom.Transform transform_; | |
| 50 int child_count_; | |
| 51 }; | |
| 52 | |
| 53 base::subtle::Atomic32 offset_; | |
|
rjkroege
2017/06/02 22:45:45
why?
I see. You are treating this a bit like a co
| |
| 54 int count_; | |
| 55 int size_; | |
| 56 Element regions_[]; | |
|
rjkroege
2017/06/02 22:45:45
How are you sizing this? C++ is really very stupid
| |
| 57 }; | |
| 58 | |
| 59 } // namespace viz | |
| 60 | |
| 61 #endif // COMPONENTS_VIZ_HITTEST_HITTEST_AGGREGATOR_H_ | |
| OLD | NEW |