| 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 "cc/layers/solid_color_layer_impl.h" | 5 #include "cc/layers/solid_color_layer_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 AppendQuadsData data; | 94 AppendQuadsData data; |
| 95 layer->AppendQuads(render_pass.get(), &data); | 95 layer->AppendQuads(render_pass.get(), &data); |
| 96 | 96 |
| 97 ASSERT_EQ(render_pass->quad_list.size(), 1U); | 97 ASSERT_EQ(render_pass->quad_list.size(), 1U); |
| 98 EXPECT_EQ(opacity, | 98 EXPECT_EQ(opacity, |
| 99 SolidColorDrawQuad::MaterialCast(render_pass->quad_list.front()) | 99 SolidColorDrawQuad::MaterialCast(render_pass->quad_list.front()) |
| 100 ->shared_quad_state->opacity); | 100 ->shared_quad_state->opacity); |
| 101 } | 101 } |
| 102 | 102 |
| 103 TEST(SolidColorLayerImplTest, VerifyCorrectBlendModeInQuad) { | 103 TEST(SolidColorLayerImplTest, VerifyCorrectBlendModeInQuad) { |
| 104 const SkXfermode::Mode blend_mode = SkXfermode::kMultiply_Mode; | 104 const SkBlendMode blend_mode = SkBlendMode::kMultiply; |
| 105 | 105 |
| 106 std::unique_ptr<RenderPass> render_pass = RenderPass::Create(); | 106 std::unique_ptr<RenderPass> render_pass = RenderPass::Create(); |
| 107 | 107 |
| 108 gfx::Size layer_size = gfx::Size(100, 100); | 108 gfx::Size layer_size = gfx::Size(100, 100); |
| 109 | 109 |
| 110 FakeImplTaskRunnerProvider task_runner_provider; | 110 FakeImplTaskRunnerProvider task_runner_provider; |
| 111 TestTaskGraphRunner task_graph_runner; | 111 TestTaskGraphRunner task_graph_runner; |
| 112 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); | 112 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); |
| 113 std::unique_ptr<SolidColorLayerImpl> layer = | 113 std::unique_ptr<SolidColorLayerImpl> layer = |
| 114 SolidColorLayerImpl::Create(host_impl.active_tree(), 1); | 114 SolidColorLayerImpl::Create(host_impl.active_tree(), 1); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 LayerTestCommon::VerifyQuadsAreOccluded( | 240 LayerTestCommon::VerifyQuadsAreOccluded( |
| 241 impl.quad_list(), occluded, &partially_occluded_count); | 241 impl.quad_list(), occluded, &partially_occluded_count); |
| 242 // 4 quads are completely occluded, 8 are partially occluded. | 242 // 4 quads are completely occluded, 8 are partially occluded. |
| 243 EXPECT_EQ(16u - 4u, impl.quad_list().size()); | 243 EXPECT_EQ(16u - 4u, impl.quad_list().size()); |
| 244 EXPECT_EQ(8u, partially_occluded_count); | 244 EXPECT_EQ(8u, partially_occluded_count); |
| 245 } | 245 } |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace | 248 } // namespace |
| 249 } // namespace cc | 249 } // namespace cc |
| OLD | NEW |