| 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_DELEGATE_H_ | 5 #ifndef CC_SURFACES_SURFACE_HITTEST_DELEGATE_H_ |
| 6 #define CC_SURFACES_SURFACE_HITTEST_DELEGATE_H_ | 6 #define CC_SURFACES_SURFACE_HITTEST_DELEGATE_H_ |
| 7 | 7 |
| 8 namespace gfx { | 8 namespace gfx { |
| 9 class Point; | 9 class Point; |
| 10 } // namespace gfx | 10 } // namespace gfx |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 class SurfaceDrawQuad; | 14 class SurfaceDrawQuad; |
| 15 | 15 |
| 16 // Clients of SurfaceHittest can provide a SurfaceHittestDelegate implementation | 16 // Clients of SurfaceHittest can provide a SurfaceHittestDelegate implementation |
| 17 // to override the hit target based on metadata outside of the Surfaces system. | 17 // to override the hit target based on metadata outside of the Surfaces system. |
| 18 class SurfaceHittestDelegate { | 18 class SurfaceHittestDelegate { |
| 19 public: | 19 public: |
| 20 // Return true if this delegate rejects this |surface_quad| as a candidate hit | 20 // Return true if this delegate rejects this |surface_quad| as a candidate hit |
| 21 // target. | 21 // target. |
| 22 virtual bool RejectHitTarget(const SurfaceDrawQuad* surface_quad, | 22 virtual bool RejectHitTarget(const SurfaceDrawQuad* surface_quad, |
| 23 const gfx::Point& point_in_quad_space) = 0; | 23 const gfx::Point& point_in_quad_space) = 0; |
| 24 |
| 25 // Return true if this delegate accepts this |surface_quad| as a candidate hit |
| 26 // target. |
| 27 virtual bool AcceptHitTarget(const SurfaceDrawQuad* surface_quad, |
| 28 const gfx::Point& point_in_quad_space) = 0; |
| 24 }; | 29 }; |
| 25 | 30 |
| 26 } // namespace cc | 31 } // namespace cc |
| 27 | 32 |
| 28 #endif // CC_SURFACES_SURFACE_HITTEST_DELEGATE_H_ | 33 #endif // CC_SURFACES_SURFACE_HITTEST_DELEGATE_H_ |
| OLD | NEW |