| 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/base/scoped_ptr_vector.h" | 5 #include "cc/base/scoped_ptr_vector.h" |
| 6 #include "cc/layers/append_quads_data.h" | 6 #include "cc/layers/append_quads_data.h" |
| 7 #include "cc/layers/layer_impl.h" | 7 #include "cc/layers/layer_impl.h" |
| 8 #include "cc/layers/render_pass_sink.h" | 8 #include "cc/layers/render_pass_sink.h" |
| 9 #include "cc/layers/render_surface_impl.h" | 9 #include "cc/layers/render_surface_impl.h" |
| 10 #include "cc/quads/shared_quad_state.h" | 10 #include "cc/quads/shared_quad_state.h" |
| 11 #include "cc/test/fake_impl_proxy.h" | 11 #include "cc/test/fake_impl_proxy.h" |
| 12 #include "cc/test/fake_layer_tree_host_impl.h" | 12 #include "cc/test/fake_layer_tree_host_impl.h" |
| 13 #include "cc/test/geometry_test_utils.h" | 13 #include "cc/test/geometry_test_utils.h" |
| 14 #include "cc/test/mock_quad_culler.h" | 14 #include "cc/test/mock_quad_culler.h" |
| 15 #include "cc/trees/single_thread_proxy.h" | 15 #include "cc/trees/single_thread_proxy.h" |
| 16 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 #include "ui/gfx/transform.h" | 18 #include "ui/gfx/transform.h" |
| 19 | 19 |
| 20 namespace cc { | 20 namespace cc { |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 #define EXECUTE_AND_VERIFY_SURFACE_CHANGED(codeToTest) \ | 23 #define EXECUTE_AND_VERIFY_SURFACE_CHANGED(code_to_test) \ |
| 24 render_surface->ResetPropertyChangedFlag(); \ | 24 render_surface->ResetPropertyChangedFlag(); \ |
| 25 codeToTest; \ | 25 code_to_test; \ |
| 26 EXPECT_TRUE(render_surface->SurfacePropertyChanged()) | 26 EXPECT_TRUE(render_surface->SurfacePropertyChanged()) |
| 27 | 27 |
| 28 #define EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(codeToTest) \ | 28 #define EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(code_to_test) \ |
| 29 render_surface->ResetPropertyChangedFlag(); \ | 29 render_surface->ResetPropertyChangedFlag(); \ |
| 30 codeToTest; \ | 30 code_to_test; \ |
| 31 EXPECT_FALSE(render_surface->SurfacePropertyChanged()) | 31 EXPECT_FALSE(render_surface->SurfacePropertyChanged()) |
| 32 | 32 |
| 33 TEST(RenderSurfaceTest, VerifySurfaceChangesAreTrackedProperly) { | 33 TEST(RenderSurfaceTest, VerifySurfaceChangesAreTrackedProperly) { |
| 34 // | 34 // |
| 35 // This test checks that SurfacePropertyChanged() has the correct behavior. | 35 // This test checks that SurfacePropertyChanged() has the correct behavior. |
| 36 // | 36 // |
| 37 | 37 |
| 38 FakeImplProxy proxy; | 38 FakeImplProxy proxy; |
| 39 FakeLayerTreeHostImpl host_impl(&proxy); | 39 FakeLayerTreeHostImpl host_impl(&proxy); |
| 40 scoped_ptr<LayerImpl> owning_layer = | 40 scoped_ptr<LayerImpl> owning_layer = |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 ASSERT_EQ(1u, pass_sink.RenderPasses().size()); | 170 ASSERT_EQ(1u, pass_sink.RenderPasses().size()); |
| 171 RenderPass* pass = pass_sink.RenderPasses()[0]; | 171 RenderPass* pass = pass_sink.RenderPasses()[0]; |
| 172 | 172 |
| 173 EXPECT_EQ(RenderPass::Id(2, 0), pass->id); | 173 EXPECT_EQ(RenderPass::Id(2, 0), pass->id); |
| 174 EXPECT_RECT_EQ(content_rect, pass->output_rect); | 174 EXPECT_RECT_EQ(content_rect, pass->output_rect); |
| 175 EXPECT_EQ(origin, pass->transform_to_root_target); | 175 EXPECT_EQ(origin, pass->transform_to_root_target); |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace | 178 } // namespace |
| 179 } // namespace cc | 179 } // namespace cc |
| OLD | NEW |