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.
5 #ifndef CC_SURFACES_SURFACE_HITTEST_H_
6 #define CC_SURFACES_SURFACE_HITTEST_H_
10 #include "cc/surfaces/surface_id.h"
11 #include "cc/surfaces/surfaces_export.h"
25 // Performs a hittest in surface quads.
26 class CC_SURFACES_EXPORT SurfaceHittest
{
28 explicit SurfaceHittest(SurfaceManager
* manager
);
31 // Hittests against Surface with SurfaceId |surface_id|, return the contained
32 // surface that the point is hitting and the |transformed_point| in the
34 SurfaceId
GetTargetSurfaceAtPoint(SurfaceId surface_id
,
35 const gfx::Point
& point
,
36 gfx::Point
* transformed_point
);
39 bool GetTargetSurfaceAtPointInternal(
41 const RenderPassId
& render_pass_id
,
42 const gfx::Point
& point_in_root_target
,
43 std::set
<const RenderPass
*>* referenced_passes
,
44 SurfaceId
* out_surface_id
,
45 gfx::Point
* out_transformed_point
);
47 const RenderPass
* GetRenderPassForSurfaceById(
49 const RenderPassId
& render_pass_id
);
51 bool PointInQuad(const DrawQuad
* quad
,
52 const gfx::Point
& point_in_render_pass_space
,
53 gfx::Point
* point_in_quad_space
);
55 SurfaceManager
* const manager_
;
59 #endif // CC_SURFACES_SURFACE_HITTEST_H_