Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: cc/layers/solid_color_layer_impl_unittest.cc

Issue 2502373003: stop using SkXfermode -- use SkBlendMode instead (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/render_surface_unittest.cc ('k') | cc/output/ca_layer_overlay.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/layers/render_surface_unittest.cc ('k') | cc/output/ca_layer_overlay.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698