summaryrefslogtreecommitdiffstats
path: root/cc/surfaces/surface_hittest_delegate.h
blob: f966b7c0907ed5b8bf8d017d520412939ecb74d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_SURFACES_SURFACE_HITTEST_DELEGATE_H_
#define CC_SURFACES_SURFACE_HITTEST_DELEGATE_H_

namespace gfx {
class Point;
}  // namespace gfx

namespace cc {

class SurfaceDrawQuad;

// Clients of SurfaceHittest can provide a SurfaceHittestDelegate implementation
// to override the hit target based on metadata outside of the Surfaces system.
class SurfaceHittestDelegate {
 public:
  // Return true if this delegate rejects this |surface_quad| as a candidate hit
  // target.
  virtual bool RejectHitTarget(const SurfaceDrawQuad* surface_quad,
                               const gfx::Point& point_in_quad_space) = 0;

  // Return true if this delegate accepts this |surface_quad| as a candidate hit
  // target.
  virtual bool AcceptHitTarget(const SurfaceDrawQuad* surface_quad,
                               const gfx::Point& point_in_quad_space) = 0;
};

}  // namespace cc

#endif  // CC_SURFACES_SURFACE_HITTEST_DELEGATE_H_