Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: cc/test/surface_hittest_test_helpers.h

Issue 1663433002: Adds an interface to SurfaceHittestDelegate in order to override (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/surfaces/surface_hittest_unittest.cc ('k') | cc/test/surface_hittest_test_helpers.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « cc/surfaces/surface_hittest_unittest.cc ('k') | cc/test/surface_hittest_test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698