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