| 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_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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |