Vectorize website settings icons in omnibox
[chromium-blink-merge.git] / cc / surfaces / surface_hittest.h
blob4036165c40d229778ac1d5f3c177a2132e61e08b
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_
8 #include <set>
10 #include "cc/surfaces/surface_id.h"
11 #include "cc/surfaces/surfaces_export.h"
13 namespace gfx {
14 class Point;
17 namespace cc {
18 class RenderPass;
19 class SurfaceManager;
21 // Performs a hittest in surface quads.
22 class CC_SURFACES_EXPORT SurfaceHittest {
23 public:
24 explicit SurfaceHittest(SurfaceManager* manager);
25 ~SurfaceHittest();
27 // Hittests against Surface with SurfaceId |surface_id|, return the contained
28 // surface that the point is hitting and the |transformed_point| in the
29 // surface space.
30 SurfaceId Hittest(SurfaceId surface_id,
31 const gfx::Point& point,
32 gfx::Point* transformed_point);
34 private:
35 bool HittestInternal(SurfaceId surface_id,
36 const RenderPass* render_pass,
37 const gfx::Point& point,
38 SurfaceId* out_surface_id,
39 gfx::Point* out_transformed_point);
41 SurfaceManager* const manager_;
42 std::set<const RenderPass*> referenced_passes_;
44 } // namespace cc
46 #endif // CC_SURFACES_SURFACE_HITTEST_H_