| 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_surface_impl.h" | 7 #include "cc/layers/render_surface_impl.h" |
| 8 #include "cc/quads/shared_quad_state.h" | 8 #include "cc/quads/shared_quad_state.h" |
| 9 #include "cc/test/fake_compositor_frame_sink.h" | 9 #include "cc/test/fake_compositor_frame_sink.h" |
| 10 #include "cc/test/fake_impl_task_runner_provider.h" | 10 #include "cc/test/fake_impl_task_runner_provider.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 gfx::Transform dummy_matrix; | 79 gfx::Transform dummy_matrix; |
| 80 dummy_matrix.Translate(1.0, 2.0); | 80 dummy_matrix.Translate(1.0, 2.0); |
| 81 | 81 |
| 82 // The rest of the surface properties are either internal and should not cause | 82 // The rest of the surface properties are either internal and should not cause |
| 83 // change, or they are already accounted for by the | 83 // change, or they are already accounted for by the |
| 84 // owninglayer->layerPropertyChanged(). | 84 // owninglayer->layerPropertyChanged(). |
| 85 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE( | 85 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE( |
| 86 render_surface->SetDrawOpacity(0.5f)); | 86 render_surface->SetDrawOpacity(0.5f)); |
| 87 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE( | 87 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE( |
| 88 render_surface->SetDrawTransform(dummy_matrix)); | 88 render_surface->SetDrawTransform(dummy_matrix)); |
| 89 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(render_surface->ClearLayerLists()); | |
| 90 } | 89 } |
| 91 | 90 |
| 92 TEST(RenderSurfaceTest, SanityCheckSurfaceCreatesCorrectSharedQuadState) { | 91 TEST(RenderSurfaceTest, SanityCheckSurfaceCreatesCorrectSharedQuadState) { |
| 93 FakeImplTaskRunnerProvider task_runner_provider; | 92 FakeImplTaskRunnerProvider task_runner_provider; |
| 94 TestTaskGraphRunner task_graph_runner; | 93 TestTaskGraphRunner task_graph_runner; |
| 95 std::unique_ptr<CompositorFrameSink> compositor_frame_sink = | 94 std::unique_ptr<CompositorFrameSink> compositor_frame_sink = |
| 96 FakeCompositorFrameSink::Create3d(); | 95 FakeCompositorFrameSink::Create3d(); |
| 97 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); | 96 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); |
| 98 std::unique_ptr<LayerImpl> root_layer = | 97 std::unique_ptr<LayerImpl> root_layer = |
| 99 LayerImpl::Create(host_impl.active_tree(), 1); | 98 LayerImpl::Create(host_impl.active_tree(), 1); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 184 |
| 186 auto pass = render_surface->CreateRenderPass(); | 185 auto pass = render_surface->CreateRenderPass(); |
| 187 | 186 |
| 188 EXPECT_EQ(2, pass->id); | 187 EXPECT_EQ(2, pass->id); |
| 189 EXPECT_EQ(content_rect, pass->output_rect); | 188 EXPECT_EQ(content_rect, pass->output_rect); |
| 190 EXPECT_EQ(origin, pass->transform_to_root_target); | 189 EXPECT_EQ(origin, pass->transform_to_root_target); |
| 191 } | 190 } |
| 192 | 191 |
| 193 } // namespace | 192 } // namespace |
| 194 } // namespace cc | 193 } // namespace cc |
| OLD | NEW |