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 #include "cc/test/surface_hittest_test_helpers.h" | 5 #include "cc/test/surface_hittest_test_helpers.h" |
6 | 6 |
7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
8 #include "cc/quads/render_pass_draw_quad.h" | 8 #include "cc/quads/render_pass_draw_quad.h" |
9 #include "cc/quads/shared_quad_state.h" | 9 #include "cc/quads/shared_quad_state.h" |
10 #include "cc/quads/solid_color_draw_quad.h" | 10 #include "cc/quads/solid_color_draw_quad.h" |
11 #include "cc/quads/surface_draw_quad.h" | 11 #include "cc/quads/surface_draw_quad.h" |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 namespace test { | 14 namespace test { |
15 | 15 |
16 void CreateSharedQuadState(RenderPass* pass, | 16 void CreateSharedQuadState(RenderPass* pass, |
17 const gfx::Transform& transform, | 17 const gfx::Transform& transform, |
18 const gfx::Rect& root_rect) { | 18 const gfx::Rect& root_rect) { |
19 SharedQuadState* child_shared_state = pass->CreateAndAppendSharedQuadState(); | 19 SharedQuadState* child_shared_state = pass->CreateAndAppendSharedQuadState(); |
20 child_shared_state->SetAll(transform, root_rect.size(), root_rect, root_rect, | 20 child_shared_state->SetAll(transform, root_rect.size(), root_rect, root_rect, |
21 false, 1.0f, SkXfermode::kSrcOver_Mode, 0); | 21 false, 1.0f, SkBlendMode::kSrcOver, 0); |
22 } | 22 } |
23 | 23 |
24 void CreateSolidColorDrawQuad(RenderPass* pass, | 24 void CreateSolidColorDrawQuad(RenderPass* pass, |
25 const gfx::Transform& transform, | 25 const gfx::Transform& transform, |
26 const gfx::Rect& root_rect, | 26 const gfx::Rect& root_rect, |
27 const gfx::Rect& quad_rect) { | 27 const gfx::Rect& quad_rect) { |
28 CreateSharedQuadState(pass, transform, root_rect); | 28 CreateSharedQuadState(pass, transform, root_rect); |
29 SolidColorDrawQuad* color_quad = | 29 SolidColorDrawQuad* color_quad = |
30 pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 30 pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
31 color_quad->SetNew(pass->shared_quad_state_list.back(), quad_rect, quad_rect, | 31 color_quad->SetNew(pass->shared_quad_state_list.back(), quad_rect, quad_rect, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // If the point provided falls outside the inset, then we accept this surface. | 120 // If the point provided falls outside the inset, then we accept this surface. |
121 if (!bounds.Contains(point_in_quad_space)) { | 121 if (!bounds.Contains(point_in_quad_space)) { |
122 ++accept_target_overrides_; | 122 ++accept_target_overrides_; |
123 return true; | 123 return true; |
124 } | 124 } |
125 return false; | 125 return false; |
126 } | 126 } |
127 | 127 |
128 } // namespace test | 128 } // namespace test |
129 } // namespace cc | 129 } // namespace cc |
OLD | NEW |