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

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

Issue 2762123004: cc: LayerTreeHostImpl uses element id to tick animations (Closed)
Patch Set: review comments Created 3 years, 8 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_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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 RenderSurfaceImpl* render_surface = 55 RenderSurfaceImpl* render_surface =
56 host_impl.active_tree()->root_layer_for_testing()->GetRenderSurface(); 56 host_impl.active_tree()->root_layer_for_testing()->GetRenderSurface();
57 ASSERT_TRUE(render_surface); 57 ASSERT_TRUE(render_surface);
58 58
59 // Currently, the content_rect, clip_rect, and 59 // Currently, the content_rect, clip_rect, and
60 // owning_layer->layerPropertyChanged() are the only sources of change. 60 // owning_layer->layerPropertyChanged() are the only sources of change.
61 EXECUTE_AND_VERIFY_SURFACE_CHANGED(render_surface->SetClipRect(test_rect)); 61 EXECUTE_AND_VERIFY_SURFACE_CHANGED(render_surface->SetClipRect(test_rect));
62 EXECUTE_AND_VERIFY_SURFACE_CHANGED( 62 EXECUTE_AND_VERIFY_SURFACE_CHANGED(
63 render_surface->SetContentRectForTesting(test_rect)); 63 render_surface->SetContentRectForTesting(test_rect));
64 64
65 host_impl.active_tree()->property_trees()->effect_tree.OnOpacityAnimated( 65 host_impl.active_tree()->SetOpacityMutated(
66 0.5f, 66 host_impl.active_tree()->root_layer_for_testing()->element_id(), 0.5f);
67 host_impl.active_tree()->root_layer_for_testing()->effect_tree_index(),
68 host_impl.active_tree());
69 EXPECT_TRUE(render_surface->SurfacePropertyChanged()); 67 EXPECT_TRUE(render_surface->SurfacePropertyChanged());
70 host_impl.active_tree()->ResetAllChangeTracking(); 68 host_impl.active_tree()->ResetAllChangeTracking();
71 69
72 // Setting the surface properties to the same values again should not be 70 // Setting the surface properties to the same values again should not be
73 // considered "change". 71 // considered "change".
74 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE( 72 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(
75 render_surface->SetClipRect(test_rect)); 73 render_surface->SetClipRect(test_rect));
76 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE( 74 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(
77 render_surface->SetContentRectForTesting(test_rect)); 75 render_surface->SetContentRectForTesting(test_rect));
78 76
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 185
188 auto pass = render_surface->CreateRenderPass(); 186 auto pass = render_surface->CreateRenderPass();
189 187
190 EXPECT_EQ(2, pass->id); 188 EXPECT_EQ(2, pass->id);
191 EXPECT_EQ(content_rect, pass->output_rect); 189 EXPECT_EQ(content_rect, pass->output_rect);
192 EXPECT_EQ(origin, pass->transform_to_root_target); 190 EXPECT_EQ(origin, pass->transform_to_root_target);
193 } 191 }
194 192
195 } // namespace 193 } // namespace
196 } // namespace cc 194 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698