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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "cc/layers/append_quads_data.h" | 6 #include "cc/layers/append_quads_data.h" |
7 #include "cc/output/gl_renderer.h" | 7 #include "cc/output/gl_renderer.h" |
8 #include "cc/quads/draw_quad.h" | 8 #include "cc/quads/draw_quad.h" |
9 #include "cc/quads/picture_draw_quad.h" | 9 #include "cc/quads/picture_draw_quad.h" |
10 #include "cc/quads/texture_draw_quad.h" | 10 #include "cc/quads/texture_draw_quad.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 return pass.Pass(); | 42 return pass.Pass(); |
43 } | 43 } |
44 | 44 |
45 scoped_ptr<SharedQuadState> CreateTestSharedQuadState( | 45 scoped_ptr<SharedQuadState> CreateTestSharedQuadState( |
46 gfx::Transform content_to_target_transform, gfx::Rect rect) { | 46 gfx::Transform content_to_target_transform, gfx::Rect rect) { |
47 const gfx::Size content_bounds = rect.size(); | 47 const gfx::Size content_bounds = rect.size(); |
48 const gfx::Rect visible_content_rect = rect; | 48 const gfx::Rect visible_content_rect = rect; |
49 const gfx::Rect clip_rect = rect; | 49 const gfx::Rect clip_rect = rect; |
50 const bool is_clipped = false; | 50 const bool is_clipped = false; |
51 const float opacity = 1.0f; | 51 const float opacity = 1.0f; |
| 52 const SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode; |
52 scoped_ptr<SharedQuadState> shared_state = SharedQuadState::Create(); | 53 scoped_ptr<SharedQuadState> shared_state = SharedQuadState::Create(); |
53 shared_state->SetAll(content_to_target_transform, | 54 shared_state->SetAll(content_to_target_transform, |
54 content_bounds, | 55 content_bounds, |
55 visible_content_rect, | 56 visible_content_rect, |
56 clip_rect, | 57 clip_rect, |
57 is_clipped, | 58 is_clipped, |
58 opacity); | 59 opacity, |
| 60 blend_mode); |
59 return shared_state.Pass(); | 61 return shared_state.Pass(); |
60 } | 62 } |
61 | 63 |
62 scoped_ptr<SharedQuadState> CreateTestSharedQuadStateClipped( | 64 scoped_ptr<SharedQuadState> CreateTestSharedQuadStateClipped( |
63 gfx::Transform content_to_target_transform, | 65 gfx::Transform content_to_target_transform, |
64 gfx::Rect rect, | 66 gfx::Rect rect, |
65 gfx::Rect clip_rect) { | 67 gfx::Rect clip_rect) { |
66 const gfx::Size content_bounds = rect.size(); | 68 const gfx::Size content_bounds = rect.size(); |
67 const gfx::Rect visible_content_rect = clip_rect; | 69 const gfx::Rect visible_content_rect = clip_rect; |
68 const bool is_clipped = true; | 70 const bool is_clipped = true; |
69 const float opacity = 1.0f; | 71 const float opacity = 1.0f; |
| 72 const SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode; |
70 scoped_ptr<SharedQuadState> shared_state = SharedQuadState::Create(); | 73 scoped_ptr<SharedQuadState> shared_state = SharedQuadState::Create(); |
71 shared_state->SetAll(content_to_target_transform, | 74 shared_state->SetAll(content_to_target_transform, |
72 content_bounds, | 75 content_bounds, |
73 visible_content_rect, | 76 visible_content_rect, |
74 clip_rect, | 77 clip_rect, |
75 is_clipped, | 78 is_clipped, |
76 opacity); | 79 opacity, |
| 80 blend_mode); |
77 return shared_state.Pass(); | 81 return shared_state.Pass(); |
78 } | 82 } |
79 | 83 |
80 scoped_ptr<DrawQuad> CreateTestRenderPassDrawQuad( | 84 scoped_ptr<DrawQuad> CreateTestRenderPassDrawQuad( |
81 SharedQuadState* shared_state, gfx::Rect rect, RenderPass::Id pass_id) { | 85 SharedQuadState* shared_state, gfx::Rect rect, RenderPass::Id pass_id) { |
82 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create(); | 86 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create(); |
83 quad->SetNew(shared_state, | 87 quad->SetNew(shared_state, |
84 rect, | 88 rect, |
85 pass_id, | 89 pass_id, |
86 false, // is_replica | 90 false, // is_replica |
(...skipping 1921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2008 EXPECT_TRUE(this->RunPixelTest( | 2012 EXPECT_TRUE(this->RunPixelTest( |
2009 &pass_list, | 2013 &pass_list, |
2010 PixelTest::NoOffscreenContext, | 2014 PixelTest::NoOffscreenContext, |
2011 base::FilePath(FILE_PATH_LITERAL("four_blue_green_checkers.png")), | 2015 base::FilePath(FILE_PATH_LITERAL("four_blue_green_checkers.png")), |
2012 ExactPixelComparator(true))); | 2016 ExactPixelComparator(true))); |
2013 } | 2017 } |
2014 #endif // !defined(OS_ANDROID) | 2018 #endif // !defined(OS_ANDROID) |
2015 | 2019 |
2016 } // namespace | 2020 } // namespace |
2017 } // namespace cc | 2021 } // namespace cc |
OLD | NEW |