| 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_TEST_SURFACE_HITTEST_TEST_HELPERS_H_ | 5 #ifndef CC_TEST_SURFACE_HITTEST_TEST_HELPERS_H_ |
| 6 #define CC_TEST_SURFACE_HITTEST_TEST_HELPERS_H_ | 6 #define CC_TEST_SURFACE_HITTEST_TEST_HELPERS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 RenderPassList* render_pass_list); | 63 RenderPassList* render_pass_list); |
| 64 | 64 |
| 65 scoped_ptr<CompositorFrame> CreateCompositorFrame(const gfx::Rect& root_rect, | 65 scoped_ptr<CompositorFrame> CreateCompositorFrame(const gfx::Rect& root_rect, |
| 66 RenderPass** render_pass); | 66 RenderPass** render_pass); |
| 67 | 67 |
| 68 class TestSurfaceHittestDelegate : public SurfaceHittestDelegate { | 68 class TestSurfaceHittestDelegate : public SurfaceHittestDelegate { |
| 69 public: | 69 public: |
| 70 TestSurfaceHittestDelegate(); | 70 TestSurfaceHittestDelegate(); |
| 71 ~TestSurfaceHittestDelegate(); | 71 ~TestSurfaceHittestDelegate(); |
| 72 | 72 |
| 73 int target_overrides() const { return target_overrides_; } | 73 int reject_target_overrides() const { return reject_target_overrides_; } |
| 74 int accept_target_overrides() const { return accept_target_overrides_; } |
| 74 | 75 |
| 75 void AddInsetsForSurface(const SurfaceId& surface_id, | 76 void AddInsetsForRejectSurface(const SurfaceId& surface_id, |
| 76 const gfx::Insets& inset); | 77 const gfx::Insets& inset); |
| 78 void AddInsetsForAcceptSurface(const SurfaceId& surface_id, |
| 79 const gfx::Insets& inset); |
| 77 | 80 |
| 78 // SurfaceHittestDelegate implementation. | 81 // SurfaceHittestDelegate implementation. |
| 79 bool RejectHitTarget(const SurfaceDrawQuad* surface_quad, | 82 bool RejectHitTarget(const SurfaceDrawQuad* surface_quad, |
| 80 const gfx::Point& point_in_quad_space) override; | 83 const gfx::Point& point_in_quad_space) override; |
| 84 bool AcceptHitTarget(const SurfaceDrawQuad* surface_quad, |
| 85 const gfx::Point& point_in_quad_space) override; |
| 81 | 86 |
| 82 private: | 87 private: |
| 83 int target_overrides_; | 88 int reject_target_overrides_; |
| 84 std::map<SurfaceId, gfx::Insets> insets_for_surface_; | 89 int accept_target_overrides_; |
| 90 std::map<SurfaceId, gfx::Insets> insets_for_reject_; |
| 91 std::map<SurfaceId, gfx::Insets> insets_for_accept_; |
| 85 | 92 |
| 86 DISALLOW_COPY_AND_ASSIGN(TestSurfaceHittestDelegate); | 93 DISALLOW_COPY_AND_ASSIGN(TestSurfaceHittestDelegate); |
| 87 }; | 94 }; |
| 88 | 95 |
| 89 } // namespace test | 96 } // namespace test |
| 90 } // namespace cc | 97 } // namespace cc |
| 91 | 98 |
| 92 #endif // CC_TEST_SURFACE_HITTEST_TEST_HELPERS_H_ | 99 #endif // CC_TEST_SURFACE_HITTEST_TEST_HELPERS_H_ |
| OLD | NEW |