Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: cc/layers/render_surface_unittest.cc

Issue 2360003002: cc: Compute SurfacePropertyChanged without depending on owning layer (Closed)
Patch Set: Address review comment Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/render_surface_impl.cc ('k') | cc/proto/layer.proto » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "cc/test/fake_impl_task_runner_provider.h" 11 #include "cc/test/fake_impl_task_runner_provider.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_occlusion_tracker.h" 14 #include "cc/test/mock_occlusion_tracker.h"
15 #include "cc/test/test_shared_bitmap_manager.h" 15 #include "cc/test/test_shared_bitmap_manager.h"
16 #include "cc/test/test_task_graph_runner.h" 16 #include "cc/test/test_task_graph_runner.h"
17 #include "cc/trees/layer_tree_impl.h" 17 #include "cc/trees/layer_tree_impl.h"
18 #include "cc/trees/single_thread_proxy.h" 18 #include "cc/trees/single_thread_proxy.h"
19 #include "testing/gmock/include/gmock/gmock.h" 19 #include "testing/gmock/include/gmock/gmock.h"
20 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
21 #include "ui/gfx/transform.h" 21 #include "ui/gfx/transform.h"
22 22
23 namespace cc { 23 namespace cc {
24 namespace { 24 namespace {
25 25
26 #define EXECUTE_AND_VERIFY_SURFACE_CHANGED(code_to_test) \ 26 #define EXECUTE_AND_VERIFY_SURFACE_CHANGED(code_to_test) \
27 render_surface->ResetPropertyChangedFlag(); \ 27 render_surface->ResetPropertyChangedFlags(); \
28 code_to_test; \ 28 code_to_test; \
29 EXPECT_TRUE(render_surface->SurfacePropertyChanged()) 29 EXPECT_TRUE(render_surface->SurfacePropertyChanged())
30 30
31 #define EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(code_to_test) \ 31 #define EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(code_to_test) \
32 render_surface->ResetPropertyChangedFlag(); \ 32 render_surface->ResetPropertyChangedFlags(); \
33 code_to_test; \ 33 code_to_test; \
34 EXPECT_FALSE(render_surface->SurfacePropertyChanged()) 34 EXPECT_FALSE(render_surface->SurfacePropertyChanged())
35 35
36 TEST(RenderSurfaceTest, VerifySurfaceChangesAreTrackedProperly) { 36 TEST(RenderSurfaceTest, VerifySurfaceChangesAreTrackedProperly) {
37 // 37 //
38 // This test checks that SurfacePropertyChanged() has the correct behavior. 38 // This test checks that SurfacePropertyChanged() has the correct behavior.
39 // 39 //
40 40
41 FakeImplTaskRunnerProvider task_runner_provider; 41 FakeImplTaskRunnerProvider task_runner_provider;
42 TestSharedBitmapManager shared_bitmap_manager; 42 TestSharedBitmapManager shared_bitmap_manager;
43 TestTaskGraphRunner task_graph_runner; 43 TestTaskGraphRunner task_graph_runner;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 ASSERT_EQ(1u, pass_sink.RenderPasses().size()); 194 ASSERT_EQ(1u, pass_sink.RenderPasses().size());
195 RenderPass* pass = pass_sink.RenderPasses()[0].get(); 195 RenderPass* pass = pass_sink.RenderPasses()[0].get();
196 196
197 EXPECT_EQ(RenderPassId(2, 0), pass->id); 197 EXPECT_EQ(RenderPassId(2, 0), pass->id);
198 EXPECT_EQ(content_rect, pass->output_rect); 198 EXPECT_EQ(content_rect, pass->output_rect);
199 EXPECT_EQ(origin, pass->transform_to_root_target); 199 EXPECT_EQ(origin, pass->transform_to_root_target);
200 } 200 }
201 201
202 } // namespace 202 } // namespace
203 } // namespace cc 203 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/render_surface_impl.cc ('k') | cc/proto/layer.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698