OLD | NEW |
(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 CC_SURFACES_SURFACE_HITTEST_H_ |
| 6 #define CC_SURFACES_SURFACE_HITTEST_H_ |
| 7 |
| 8 #include <set> |
| 9 |
| 10 #include "cc/surfaces/surface_id.h" |
| 11 #include "cc/surfaces/surfaces_export.h" |
| 12 |
| 13 namespace gfx { |
| 14 class Point; |
| 15 } |
| 16 |
| 17 namespace cc { |
| 18 class RenderPass; |
| 19 class SurfaceManager; |
| 20 |
| 21 // Performs a hittest in surface quads. |
| 22 class CC_SURFACES_EXPORT SurfaceHittest { |
| 23 public: |
| 24 explicit SurfaceHittest(SurfaceManager* manager); |
| 25 ~SurfaceHittest(); |
| 26 |
| 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); |
| 33 |
| 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); |
| 40 |
| 41 SurfaceManager* const manager_; |
| 42 std::set<const RenderPass*> referenced_passes_; |
| 43 }; |
| 44 } // namespace cc |
| 45 |
| 46 #endif // CC_SURFACES_SURFACE_HITTEST_H_ |
OLD | NEW |