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

Side by Side Diff: cc/trees/layer_tree_host_unittest_animation.cc

Issue 2080703005: cc: Remove LayerTreeImpl::root_layer usage outside tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_impl.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "cc/animation/animation_curve.h" 9 #include "cc/animation/animation_curve.h"
10 #include "cc/animation/animation_host.h" 10 #include "cc/animation/animation_host.h"
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { 1332 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override {
1333 // After both animations have started, verify that they have valid 1333 // After both animations have started, verify that they have valid
1334 // start times. 1334 // start times.
1335 if (host_impl->active_tree()->source_frame_number() < 2) 1335 if (host_impl->active_tree()->source_frame_number() < 2)
1336 return; 1336 return;
1337 AnimationHost::ElementToAnimationsMap element_animations_copy = 1337 AnimationHost::ElementToAnimationsMap element_animations_copy =
1338 host_impl->animation_host()->active_element_animations_for_testing(); 1338 host_impl->animation_host()->active_element_animations_for_testing();
1339 EXPECT_EQ(2u, element_animations_copy.size()); 1339 EXPECT_EQ(2u, element_animations_copy.size());
1340 for (auto& it : element_animations_copy) { 1340 for (auto& it : element_animations_copy) {
1341 int id = it.first; 1341 int id = it.first;
1342 if (id == host_impl->RootLayer()->id()) { 1342 if (id == host_impl->active_tree()->root_layer()->id()) {
1343 Animation* anim = it.second->GetAnimation(TargetProperty::TRANSFORM); 1343 Animation* anim = it.second->GetAnimation(TargetProperty::TRANSFORM);
1344 EXPECT_GT((anim->start_time() - base::TimeTicks()).InSecondsF(), 0); 1344 EXPECT_GT((anim->start_time() - base::TimeTicks()).InSecondsF(), 0);
1345 } else if (id == layer_->id()) { 1345 } else if (id == layer_->id()) {
1346 Animation* anim = it.second->GetAnimation(TargetProperty::OPACITY); 1346 Animation* anim = it.second->GetAnimation(TargetProperty::OPACITY);
1347 EXPECT_GT((anim->start_time() - base::TimeTicks()).InSecondsF(), 0); 1347 EXPECT_GT((anim->start_time() - base::TimeTicks()).InSecondsF(), 0);
1348 } 1348 }
1349 EndTest(); 1349 EndTest();
1350 } 1350 }
1351 } 1351 }
1352 1352
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1771 private: 1771 private:
1772 scoped_refptr<Layer> layer_; 1772 scoped_refptr<Layer> layer_;
1773 FakeContentLayerClient client_; 1773 FakeContentLayerClient client_;
1774 }; 1774 };
1775 1775
1776 MULTI_THREAD_TEST_F( 1776 MULTI_THREAD_TEST_F(
1777 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); 1777 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit);
1778 1778
1779 } // namespace 1779 } // namespace
1780 } // namespace cc 1780 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698