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

Side by Side Diff: components/viz/hittest/hittest.h

Issue 2908783002: WIP Hittest Component.
Patch Set: format 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 2015 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_H_
6 #define COMPONENTS_VIZ_HITTEST_HITTEST_H_
7
8 #include <stdint.h>
9
10 #include <map>
11 #include <memory>
12
13 #include "cc/output/compositor_frame.h"
rjkroege 2017/05/29 15:58:02 not a correct dependency in my opinion.
14 #include "cc/surfaces/surface_id.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 // Hittest
rjkroege 2017/05/29 15:58:03 you could merge this line with the one below
22 // Maintains maping between display regions and associated surfaces
23 // in shared memory to enable efficient hit testing across processes.
24 //
25 // This is intended to be created in the viz or GPU process. For mus+ash this
26 // will be true after the mus process split.
27
rjkroege 2017/05/29 15:58:03 no space? git cl format?
28 class HITTEST_EXPORT Hittest {
29 public:
30 static cc::SurfaceId SurfaceIdAtPoint(cc::SurfaceId root_surface_id,
rjkroege 2017/05/29 15:58:03 i'm not sure that this is right.
gklassen 2017/06/05 21:32:13 what would you change?
31 const gfx::Point& point,
32 gfx::Point* transformed_point) {
33 return GetInstance()->InternalGetSurfaceIdAtPoint(root_surface_id, point,
34 transformed_point);
35 }
36
37 static void DisplayWillDrawAndSwap(bool will_draw_and_swap,
rjkroege 2017/05/29 15:58:03 seems not right. hittest component should provide
38 const cc::RenderPassList& render_passes) {
39 GetInstance()->Aggregate();
40 }
41
42 private:
43 static Hittest* instance_;
44
45 static Hittest* GetInstance() {
rjkroege 2017/05/29 15:58:03 are you trying to create a singleton? I'd argue th
46 if (instance_ == NULL) {
47 instance_ = new Hittest();
48 }
49 return instance_;
50 }
51
52 Hittest();
53 ~Hittest();
54
55 std::map<cc::SurfaceId, viz::hittest::mojom::HittestData> pending_;
56
57 struct Region;
58 std::vector<Region> regions_[2];
rjkroege 2017/05/29 15:58:03 this is the shared memory? AFAIK: vector is not a
59 std::vector<Region>* current_regions_;
60
61 cc::SurfaceId InternalGetSurfaceIdAtPoint(cc::SurfaceId root_surface_id,
rjkroege 2017/05/29 15:58:02 these all need method comments?
62 const gfx::Point& point,
63 gfx::Point* transformed_point);
64
65 void SubmitHittestData(viz::hittest::mojom::HittestData& hittest_data);
66
67 void Aggregate();
68
69 void swap();
70 };
71
72 } // namespace viz
73
74 #endif // COMPONENTS_VIZ_HITTEST_HITTEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698