OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_SURFACES_SURFACE_HITTEST_H_ | 5 #ifndef CC_SURFACES_SURFACE_HITTEST_H_ |
6 #define CC_SURFACES_SURFACE_HITTEST_H_ | 6 #define CC_SURFACES_SURFACE_HITTEST_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "cc/surfaces/surface_id.h" | 10 #include "cc/surfaces/surface_id.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 // Performs a hittest in surface quads. | 27 // Performs a hittest in surface quads. |
28 class CC_SURFACES_EXPORT SurfaceHittest { | 28 class CC_SURFACES_EXPORT SurfaceHittest { |
29 public: | 29 public: |
30 SurfaceHittest(SurfaceHittestDelegate* delegate, SurfaceManager* manager); | 30 SurfaceHittest(SurfaceHittestDelegate* delegate, SurfaceManager* manager); |
31 ~SurfaceHittest(); | 31 ~SurfaceHittest(); |
32 | 32 |
33 // Returns the target surface that falls underneath the provided |point|. | 33 // Returns the target surface that falls underneath the provided |point|. |
34 // Also returns the |transform| to convert the |point| to the target surface's | 34 // Also returns the |transform| to convert the |point| to the target surface's |
35 // space. | 35 // space. |
36 SurfaceId GetTargetSurfaceAtPoint(SurfaceId root_surface_id, | 36 SurfaceId GetTargetSurfaceAtPoint(const SurfaceId& root_surface_id, |
37 const gfx::Point& point, | 37 const gfx::Point& point, |
38 gfx::Transform* transform); | 38 gfx::Transform* transform); |
39 | 39 |
40 // Returns whether the target surface falls inside the provide root surface. | 40 // Returns whether the target surface falls inside the provide root surface. |
41 // Returns the |transform| to convert points from the root surface coordinate | 41 // Returns the |transform| to convert points from the root surface coordinate |
42 // space to the target surface coordinate space. | 42 // space to the target surface coordinate space. |
43 bool GetTransformToTargetSurface(SurfaceId root_surface_id, | 43 bool GetTransformToTargetSurface(const SurfaceId& root_surface_id, |
44 SurfaceId target_surface_id, | 44 const SurfaceId& target_surface_id, |
45 gfx::Transform* transform); | 45 gfx::Transform* transform); |
46 | 46 |
47 private: | 47 private: |
48 bool GetTargetSurfaceAtPointInternal( | 48 bool GetTargetSurfaceAtPointInternal( |
49 SurfaceId surface_id, | 49 const SurfaceId& surface_id, |
50 const RenderPassId& render_pass_id, | 50 const RenderPassId& render_pass_id, |
51 const gfx::Point& point_in_root_target, | 51 const gfx::Point& point_in_root_target, |
52 std::set<const RenderPass*>* referenced_passes, | 52 std::set<const RenderPass*>* referenced_passes, |
53 SurfaceId* out_surface_id, | 53 SurfaceId* out_surface_id, |
54 gfx::Transform* out_transform); | 54 gfx::Transform* out_transform); |
55 | 55 |
56 bool GetTransformToTargetSurfaceInternal( | 56 bool GetTransformToTargetSurfaceInternal( |
57 SurfaceId root_surface_id, | 57 const SurfaceId& root_surface_id, |
58 SurfaceId target_surface_id, | 58 const SurfaceId& target_surface_id, |
59 const RenderPassId& render_pass_id, | 59 const RenderPassId& render_pass_id, |
60 std::set<const RenderPass*>* referenced_passes, | 60 std::set<const RenderPass*>* referenced_passes, |
61 gfx::Transform* out_transform); | 61 gfx::Transform* out_transform); |
62 | 62 |
63 const RenderPass* GetRenderPassForSurfaceById( | 63 const RenderPass* GetRenderPassForSurfaceById( |
64 SurfaceId surface_id, | 64 const SurfaceId& surface_id, |
65 const RenderPassId& render_pass_id); | 65 const RenderPassId& render_pass_id); |
66 | 66 |
67 bool PointInQuad(const DrawQuad* quad, | 67 bool PointInQuad(const DrawQuad* quad, |
68 const gfx::Point& point_in_render_pass_space, | 68 const gfx::Point& point_in_render_pass_space, |
69 gfx::Transform* target_to_quad_transform, | 69 gfx::Transform* target_to_quad_transform, |
70 gfx::Point* point_in_quad_space); | 70 gfx::Point* point_in_quad_space); |
71 | 71 |
72 SurfaceHittestDelegate* const delegate_; | 72 SurfaceHittestDelegate* const delegate_; |
73 SurfaceManager* const manager_; | 73 SurfaceManager* const manager_; |
74 }; | 74 }; |
75 } // namespace cc | 75 } // namespace cc |
76 | 76 |
77 #endif // CC_SURFACES_SURFACE_HITTEST_H_ | 77 #endif // CC_SURFACES_SURFACE_HITTEST_H_ |
OLD | NEW |