| OLD | NEW |
| 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_impl_task_runner_provider.h" | 10 #include "cc/test/fake_impl_task_runner_provider.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 &task_graph_runner); | 95 &task_graph_runner); |
| 96 std::unique_ptr<LayerImpl> root_layer = | 96 std::unique_ptr<LayerImpl> root_layer = |
| 97 LayerImpl::Create(host_impl.active_tree(), 1); | 97 LayerImpl::Create(host_impl.active_tree(), 1); |
| 98 | 98 |
| 99 std::unique_ptr<LayerImpl> owning_layer = | 99 std::unique_ptr<LayerImpl> owning_layer = |
| 100 LayerImpl::Create(host_impl.active_tree(), 2); | 100 LayerImpl::Create(host_impl.active_tree(), 2); |
| 101 owning_layer->SetHasRenderSurface(true); | 101 owning_layer->SetHasRenderSurface(true); |
| 102 ASSERT_TRUE(owning_layer->render_surface()); | 102 ASSERT_TRUE(owning_layer->render_surface()); |
| 103 | 103 |
| 104 SkXfermode::Mode blend_mode = SkXfermode::kSoftLight_Mode; | 104 SkXfermode::Mode blend_mode = SkXfermode::kSoftLight_Mode; |
| 105 owning_layer->SetBlendMode(blend_mode); | 105 owning_layer->test_properties()->blend_mode = blend_mode; |
| 106 RenderSurfaceImpl* render_surface = owning_layer->render_surface(); | 106 RenderSurfaceImpl* render_surface = owning_layer->render_surface(); |
| 107 | 107 |
| 108 root_layer->test_properties()->AddChild(std::move(owning_layer)); | 108 root_layer->test_properties()->AddChild(std::move(owning_layer)); |
| 109 host_impl.active_tree()->SetRootLayerForTesting(std::move(root_layer)); | 109 host_impl.active_tree()->SetRootLayerForTesting(std::move(root_layer)); |
| 110 host_impl.SetVisible(true); | 110 host_impl.SetVisible(true); |
| 111 host_impl.InitializeRenderer(output_surface.get()); | 111 host_impl.InitializeRenderer(output_surface.get()); |
| 112 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); | 112 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); |
| 113 host_impl.active_tree()->UpdateDrawProperties(false /* update_lcd_text */); | 113 host_impl.active_tree()->UpdateDrawProperties(false /* update_lcd_text */); |
| 114 | 114 |
| 115 gfx::Rect content_rect(0, 0, 50, 50); | 115 gfx::Rect content_rect(0, 0, 50, 50); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 ASSERT_EQ(1u, pass_sink.RenderPasses().size()); | 189 ASSERT_EQ(1u, pass_sink.RenderPasses().size()); |
| 190 RenderPass* pass = pass_sink.RenderPasses()[0].get(); | 190 RenderPass* pass = pass_sink.RenderPasses()[0].get(); |
| 191 | 191 |
| 192 EXPECT_EQ(RenderPassId(2, 0), pass->id); | 192 EXPECT_EQ(RenderPassId(2, 0), pass->id); |
| 193 EXPECT_EQ(content_rect, pass->output_rect); | 193 EXPECT_EQ(content_rect, pass->output_rect); |
| 194 EXPECT_EQ(origin, pass->transform_to_root_target); | 194 EXPECT_EQ(origin, pass->transform_to_root_target); |
| 195 } | 195 } |
| 196 | 196 |
| 197 } // namespace | 197 } // namespace |
| 198 } // namespace cc | 198 } // namespace cc |
| OLD | NEW |