OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 SharedQuadState* CreateTestSharedQuadState( | 57 SharedQuadState* CreateTestSharedQuadState( |
58 gfx::Transform quad_to_target_transform, | 58 gfx::Transform quad_to_target_transform, |
59 const gfx::Rect& rect, | 59 const gfx::Rect& rect, |
60 RenderPass* render_pass) { | 60 RenderPass* render_pass) { |
61 const gfx::Size layer_bounds = rect.size(); | 61 const gfx::Size layer_bounds = rect.size(); |
62 const gfx::Rect visible_layer_rect = rect; | 62 const gfx::Rect visible_layer_rect = rect; |
63 const gfx::Rect clip_rect = rect; | 63 const gfx::Rect clip_rect = rect; |
64 const bool is_clipped = false; | 64 const bool is_clipped = false; |
65 const float opacity = 1.0f; | 65 const float opacity = 1.0f; |
66 const SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode; | 66 const SkBlendMode blend_mode = SkBlendMode::kSrcOver; |
67 int sorting_context_id = 0; | 67 int sorting_context_id = 0; |
68 SharedQuadState* shared_state = render_pass->CreateAndAppendSharedQuadState(); | 68 SharedQuadState* shared_state = render_pass->CreateAndAppendSharedQuadState(); |
69 shared_state->SetAll(quad_to_target_transform, layer_bounds, | 69 shared_state->SetAll(quad_to_target_transform, layer_bounds, |
70 visible_layer_rect, clip_rect, is_clipped, opacity, | 70 visible_layer_rect, clip_rect, is_clipped, opacity, |
71 blend_mode, sorting_context_id); | 71 blend_mode, sorting_context_id); |
72 return shared_state; | 72 return shared_state; |
73 } | 73 } |
74 | 74 |
75 SharedQuadState* CreateTestSharedQuadStateClipped( | 75 SharedQuadState* CreateTestSharedQuadStateClipped( |
76 gfx::Transform quad_to_target_transform, | 76 gfx::Transform quad_to_target_transform, |
77 const gfx::Rect& rect, | 77 const gfx::Rect& rect, |
78 const gfx::Rect& clip_rect, | 78 const gfx::Rect& clip_rect, |
79 RenderPass* render_pass) { | 79 RenderPass* render_pass) { |
80 const gfx::Size layer_bounds = rect.size(); | 80 const gfx::Size layer_bounds = rect.size(); |
81 const gfx::Rect visible_layer_rect = clip_rect; | 81 const gfx::Rect visible_layer_rect = clip_rect; |
82 const bool is_clipped = true; | 82 const bool is_clipped = true; |
83 const float opacity = 1.0f; | 83 const float opacity = 1.0f; |
84 const SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode; | 84 const SkBlendMode blend_mode = SkBlendMode::kSrcOver; |
85 int sorting_context_id = 0; | 85 int sorting_context_id = 0; |
86 SharedQuadState* shared_state = render_pass->CreateAndAppendSharedQuadState(); | 86 SharedQuadState* shared_state = render_pass->CreateAndAppendSharedQuadState(); |
87 shared_state->SetAll(quad_to_target_transform, layer_bounds, | 87 shared_state->SetAll(quad_to_target_transform, layer_bounds, |
88 visible_layer_rect, clip_rect, is_clipped, opacity, | 88 visible_layer_rect, clip_rect, is_clipped, opacity, |
89 blend_mode, sorting_context_id); | 89 blend_mode, sorting_context_id); |
90 return shared_state; | 90 return shared_state; |
91 } | 91 } |
92 | 92 |
93 void CreateTestRenderPassDrawQuad(const SharedQuadState* shared_state, | 93 void CreateTestRenderPassDrawQuad(const SharedQuadState* shared_state, |
94 const gfx::Rect& rect, | 94 const gfx::Rect& rect, |
(...skipping 3177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3272 | 3272 |
3273 EXPECT_TRUE(this->RunPixelTest( | 3273 EXPECT_TRUE(this->RunPixelTest( |
3274 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), | 3274 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), |
3275 FuzzyPixelOffByOneComparator(true))); | 3275 FuzzyPixelOffByOneComparator(true))); |
3276 } | 3276 } |
3277 | 3277 |
3278 #endif // !defined(OS_ANDROID) | 3278 #endif // !defined(OS_ANDROID) |
3279 | 3279 |
3280 } // namespace | 3280 } // namespace |
3281 } // namespace cc | 3281 } // namespace cc |
OLD | NEW |