Chromium Code Reviews| 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" |
| 11 #include "cc/test/fake_layer_tree_host_impl.h" | 11 #include "cc/test/fake_layer_tree_host_impl.h" |
| 12 #include "cc/test/geometry_test_utils.h" | 12 #include "cc/test/geometry_test_utils.h" |
| 13 #include "cc/test/mock_occlusion_tracker.h" | 13 #include "cc/test/mock_occlusion_tracker.h" |
| 14 #include "cc/test/test_shared_bitmap_manager.h" | 14 #include "cc/test/test_shared_bitmap_manager.h" |
| 15 #include "cc/test/test_task_graph_runner.h" | 15 #include "cc/test/test_task_graph_runner.h" |
| 16 #include "cc/trees/draw_property_utils.h" | |
| 16 #include "cc/trees/layer_tree_impl.h" | 17 #include "cc/trees/layer_tree_impl.h" |
| 17 #include "cc/trees/single_thread_proxy.h" | 18 #include "cc/trees/single_thread_proxy.h" |
| 18 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 20 #include "ui/gfx/transform.h" | 21 #include "ui/gfx/transform.h" |
| 21 | 22 |
| 22 namespace cc { | 23 namespace cc { |
| 23 namespace { | 24 namespace { |
| 24 | 25 |
| 25 #define EXECUTE_AND_VERIFY_SURFACE_CHANGED(code_to_test) \ | 26 #define EXECUTE_AND_VERIFY_SURFACE_CHANGED(code_to_test) \ |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 owning_layer->SetHasRenderSurface(true); | 99 owning_layer->SetHasRenderSurface(true); |
| 99 ASSERT_TRUE(owning_layer->render_surface()); | 100 ASSERT_TRUE(owning_layer->render_surface()); |
| 100 | 101 |
| 101 SkXfermode::Mode blend_mode = SkXfermode::kSoftLight_Mode; | 102 SkXfermode::Mode blend_mode = SkXfermode::kSoftLight_Mode; |
| 102 owning_layer->SetBlendMode(blend_mode); | 103 owning_layer->SetBlendMode(blend_mode); |
| 103 RenderSurfaceImpl* render_surface = owning_layer->render_surface(); | 104 RenderSurfaceImpl* render_surface = owning_layer->render_surface(); |
| 104 | 105 |
| 105 root_layer->test_properties()->AddChild(std::move(owning_layer)); | 106 root_layer->test_properties()->AddChild(std::move(owning_layer)); |
| 106 host_impl.active_tree()->SetRootLayerForTesting(std::move(root_layer)); | 107 host_impl.active_tree()->SetRootLayerForTesting(std::move(root_layer)); |
| 107 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); | 108 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); |
| 109 EXPECT_TRUE( | |
| 110 host_impl.active_tree()->property_trees()->effect_tree.needs_update()); | |
| 111 draw_property_utils::ComputeEffects( | |
|
ajuma
2016/07/19 21:59:58
Would it make sense to call active_tree()->UpdateD
jaydasika
2016/07/19 22:56:11
Done.
| |
| 112 &(host_impl.active_tree()->property_trees()->effect_tree)); | |
| 108 | 113 |
| 109 gfx::Rect content_rect(0, 0, 50, 50); | 114 gfx::Rect content_rect(0, 0, 50, 50); |
| 110 gfx::Rect clip_rect(5, 5, 40, 40); | 115 gfx::Rect clip_rect(5, 5, 40, 40); |
| 111 gfx::Transform origin; | 116 gfx::Transform origin; |
| 112 origin.Translate(30, 40); | 117 origin.Translate(30, 40); |
| 113 | 118 |
| 114 render_surface->SetContentRectForTesting(content_rect); | 119 render_surface->SetContentRectForTesting(content_rect); |
| 115 render_surface->SetClipRect(clip_rect); | 120 render_surface->SetClipRect(clip_rect); |
| 116 render_surface->SetDrawOpacity(1.f); | 121 render_surface->SetDrawOpacity(1.f); |
| 117 | 122 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 183 ASSERT_EQ(1u, pass_sink.RenderPasses().size()); | 188 ASSERT_EQ(1u, pass_sink.RenderPasses().size()); |
| 184 RenderPass* pass = pass_sink.RenderPasses()[0].get(); | 189 RenderPass* pass = pass_sink.RenderPasses()[0].get(); |
| 185 | 190 |
| 186 EXPECT_EQ(RenderPassId(2, 0), pass->id); | 191 EXPECT_EQ(RenderPassId(2, 0), pass->id); |
| 187 EXPECT_EQ(content_rect, pass->output_rect); | 192 EXPECT_EQ(content_rect, pass->output_rect); |
| 188 EXPECT_EQ(origin, pass->transform_to_root_target); | 193 EXPECT_EQ(origin, pass->transform_to_root_target); |
| 189 } | 194 } |
| 190 | 195 |
| 191 } // namespace | 196 } // namespace |
| 192 } // namespace cc | 197 } // namespace cc |
| OLD | NEW |