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

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

Issue 2502373003: stop using SkXfermode -- use SkBlendMode instead (Closed)
Patch Set: rebase Created 4 years, 1 month 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_impl.cc ('k') | cc/layers/solid_color_layer_impl_unittest.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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/append_quads_data.h" 5 #include "cc/layers/append_quads_data.h"
6 #include "cc/layers/layer_impl.h" 6 #include "cc/layers/layer_impl.h"
7 #include "cc/layers/render_pass_sink.h" 7 #include "cc/layers/render_pass_sink.h"
8 #include "cc/layers/render_surface_impl.h" 8 #include "cc/layers/render_surface_impl.h"
9 #include "cc/quads/shared_quad_state.h" 9 #include "cc/quads/shared_quad_state.h"
10 #include "cc/test/fake_compositor_frame_sink.h" 10 #include "cc/test/fake_compositor_frame_sink.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 FakeCompositorFrameSink::Create3d(); 92 FakeCompositorFrameSink::Create3d();
93 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); 93 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner);
94 std::unique_ptr<LayerImpl> root_layer = 94 std::unique_ptr<LayerImpl> root_layer =
95 LayerImpl::Create(host_impl.active_tree(), 1); 95 LayerImpl::Create(host_impl.active_tree(), 1);
96 96
97 std::unique_ptr<LayerImpl> owning_layer = 97 std::unique_ptr<LayerImpl> owning_layer =
98 LayerImpl::Create(host_impl.active_tree(), 2); 98 LayerImpl::Create(host_impl.active_tree(), 2);
99 owning_layer->SetHasRenderSurface(true); 99 owning_layer->SetHasRenderSurface(true);
100 ASSERT_TRUE(owning_layer->render_surface()); 100 ASSERT_TRUE(owning_layer->render_surface());
101 101
102 SkXfermode::Mode blend_mode = SkXfermode::kSoftLight_Mode; 102 SkBlendMode blend_mode = SkBlendMode::kSoftLight;
103 owning_layer->test_properties()->blend_mode = blend_mode; 103 owning_layer->test_properties()->blend_mode = blend_mode;
104 RenderSurfaceImpl* render_surface = owning_layer->render_surface(); 104 RenderSurfaceImpl* render_surface = owning_layer->render_surface();
105 105
106 root_layer->test_properties()->AddChild(std::move(owning_layer)); 106 root_layer->test_properties()->AddChild(std::move(owning_layer));
107 host_impl.active_tree()->SetRootLayerForTesting(std::move(root_layer)); 107 host_impl.active_tree()->SetRootLayerForTesting(std::move(root_layer));
108 host_impl.SetVisible(true); 108 host_impl.SetVisible(true);
109 host_impl.InitializeRenderer(compositor_frame_sink.get()); 109 host_impl.InitializeRenderer(compositor_frame_sink.get());
110 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); 110 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting();
111 host_impl.active_tree()->UpdateDrawProperties(false /* update_lcd_text */); 111 host_impl.active_tree()->UpdateDrawProperties(false /* update_lcd_text */);
112 112
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 ASSERT_EQ(1u, pass_sink.RenderPasses().size()); 185 ASSERT_EQ(1u, pass_sink.RenderPasses().size());
186 RenderPass* pass = pass_sink.RenderPasses()[0].get(); 186 RenderPass* pass = pass_sink.RenderPasses()[0].get();
187 187
188 EXPECT_EQ(RenderPassId(2, 0), pass->id); 188 EXPECT_EQ(RenderPassId(2, 0), pass->id);
189 EXPECT_EQ(content_rect, pass->output_rect); 189 EXPECT_EQ(content_rect, pass->output_rect);
190 EXPECT_EQ(origin, pass->transform_to_root_target); 190 EXPECT_EQ(origin, pass->transform_to_root_target);
191 } 191 }
192 192
193 } // namespace 193 } // namespace
194 } // namespace cc 194 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/render_surface_impl.cc ('k') | cc/layers/solid_color_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698