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

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

Issue 1995133002: cc : Delete ResetFlags in property trees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/layer_unittest.cc ('k') | cc/trees/damage_tracker_unittest.cc » ('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_impl_task_runner_provider.h" 10 #include "cc/test/fake_impl_task_runner_provider.h"
(...skipping 30 matching lines...) Expand all
41 TestSharedBitmapManager shared_bitmap_manager; 41 TestSharedBitmapManager shared_bitmap_manager;
42 TestTaskGraphRunner task_graph_runner; 42 TestTaskGraphRunner task_graph_runner;
43 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, 43 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager,
44 &task_graph_runner); 44 &task_graph_runner);
45 std::unique_ptr<LayerImpl> owning_layer = 45 std::unique_ptr<LayerImpl> owning_layer =
46 LayerImpl::Create(host_impl.active_tree(), 1); 46 LayerImpl::Create(host_impl.active_tree(), 1);
47 owning_layer->SetHasRenderSurface(true); 47 owning_layer->SetHasRenderSurface(true);
48 ASSERT_TRUE(owning_layer->render_surface()); 48 ASSERT_TRUE(owning_layer->render_surface());
49 RenderSurfaceImpl* render_surface = owning_layer->render_surface(); 49 RenderSurfaceImpl* render_surface = owning_layer->render_surface();
50 gfx::Rect test_rect(3, 4, 5, 6); 50 gfx::Rect test_rect(3, 4, 5, 6);
51 host_impl.active_tree()->ResetAllChangeTracking( 51 host_impl.active_tree()->ResetAllChangeTracking();
52 PropertyTrees::ResetFlags::ALL_TREES);
53 52
54 // Currently, the content_rect, clip_rect, and 53 // Currently, the content_rect, clip_rect, and
55 // owning_layer->layerPropertyChanged() are the only sources of change. 54 // owning_layer->layerPropertyChanged() are the only sources of change.
56 EXECUTE_AND_VERIFY_SURFACE_CHANGED(render_surface->SetClipRect(test_rect)); 55 EXECUTE_AND_VERIFY_SURFACE_CHANGED(render_surface->SetClipRect(test_rect));
57 EXECUTE_AND_VERIFY_SURFACE_CHANGED( 56 EXECUTE_AND_VERIFY_SURFACE_CHANGED(
58 render_surface->SetContentRectForTesting(test_rect)); 57 render_surface->SetContentRectForTesting(test_rect));
59 58
60 owning_layer->SetOpacity(0.5f); 59 owning_layer->SetOpacity(0.5f);
61 EXPECT_TRUE(render_surface->SurfacePropertyChanged()); 60 EXPECT_TRUE(render_surface->SurfacePropertyChanged());
62 host_impl.active_tree()->ResetAllChangeTracking( 61 host_impl.active_tree()->ResetAllChangeTracking();
63 PropertyTrees::ResetFlags::ALL_TREES);
64 62
65 // Setting the surface properties to the same values again should not be 63 // Setting the surface properties to the same values again should not be
66 // considered "change". 64 // considered "change".
67 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE( 65 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(
68 render_surface->SetClipRect(test_rect)); 66 render_surface->SetClipRect(test_rect));
69 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE( 67 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(
70 render_surface->SetContentRectForTesting(test_rect)); 68 render_surface->SetContentRectForTesting(test_rect));
71 69
72 std::unique_ptr<LayerImpl> dummy_mask = 70 std::unique_ptr<LayerImpl> dummy_mask =
73 LayerImpl::Create(host_impl.active_tree(), 2); 71 LayerImpl::Create(host_impl.active_tree(), 2);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 ASSERT_EQ(1u, pass_sink.RenderPasses().size()); 183 ASSERT_EQ(1u, pass_sink.RenderPasses().size());
186 RenderPass* pass = pass_sink.RenderPasses()[0].get(); 184 RenderPass* pass = pass_sink.RenderPasses()[0].get();
187 185
188 EXPECT_EQ(RenderPassId(2, 0), pass->id); 186 EXPECT_EQ(RenderPassId(2, 0), pass->id);
189 EXPECT_EQ(content_rect, pass->output_rect); 187 EXPECT_EQ(content_rect, pass->output_rect);
190 EXPECT_EQ(origin, pass->transform_to_root_target); 188 EXPECT_EQ(origin, pass->transform_to_root_target);
191 } 189 }
192 190
193 } // namespace 191 } // namespace
194 } // namespace cc 192 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_unittest.cc ('k') | cc/trees/damage_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698