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

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

Issue 1975623002: cc : Add LayerToPropertyTreeIndices map to PropertyTrees (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
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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); 52 PropertyTrees::Types::EFFECT_AND_TRANSFORM_TREES);
53 53
54 // Currently, the content_rect, clip_rect, and 54 // Currently, the content_rect, clip_rect, and
55 // owning_layer->layerPropertyChanged() are the only sources of change. 55 // owning_layer->layerPropertyChanged() are the only sources of change.
56 EXECUTE_AND_VERIFY_SURFACE_CHANGED(render_surface->SetClipRect(test_rect)); 56 EXECUTE_AND_VERIFY_SURFACE_CHANGED(render_surface->SetClipRect(test_rect));
57 EXECUTE_AND_VERIFY_SURFACE_CHANGED( 57 EXECUTE_AND_VERIFY_SURFACE_CHANGED(
58 render_surface->SetContentRectForTesting(test_rect)); 58 render_surface->SetContentRectForTesting(test_rect));
59 59
60 owning_layer->SetOpacity(0.5f); 60 owning_layer->SetOpacity(0.5f);
61 EXPECT_TRUE(render_surface->SurfacePropertyChanged()); 61 EXPECT_TRUE(render_surface->SurfacePropertyChanged());
62 host_impl.active_tree()->ResetAllChangeTracking( 62 host_impl.active_tree()->ResetAllChangeTracking(
63 PropertyTrees::ResetFlags::ALL_TREES); 63 PropertyTrees::Types::EFFECT_AND_TRANSFORM_TREES);
64 64
65 // Setting the surface properties to the same values again should not be 65 // Setting the surface properties to the same values again should not be
66 // considered "change". 66 // considered "change".
67 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE( 67 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(
68 render_surface->SetClipRect(test_rect)); 68 render_surface->SetClipRect(test_rect));
69 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE( 69 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(
70 render_surface->SetContentRectForTesting(test_rect)); 70 render_surface->SetContentRectForTesting(test_rect));
71 71
72 std::unique_ptr<LayerImpl> dummy_mask = 72 std::unique_ptr<LayerImpl> dummy_mask =
73 LayerImpl::Create(host_impl.active_tree(), 2); 73 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()); 185 ASSERT_EQ(1u, pass_sink.RenderPasses().size());
186 RenderPass* pass = pass_sink.RenderPasses()[0].get(); 186 RenderPass* pass = pass_sink.RenderPasses()[0].get();
187 187
188 EXPECT_EQ(RenderPassId(2, 0), pass->id); 188 EXPECT_EQ(RenderPassId(2, 0), pass->id);
189 EXPECT_EQ(content_rect, pass->output_rect); 189 EXPECT_EQ(content_rect, pass->output_rect);
190 EXPECT_EQ(origin, pass->transform_to_root_target); 190 EXPECT_EQ(origin, pass->transform_to_root_target);
191 } 191 }
192 192
193 } // namespace 193 } // namespace
194 } // namespace cc 194 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698