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

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

Issue 1921583003: CC Animation: Let MutatorHostClient deals with elements instead of layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@elementid
Patch Set: Rename methods in ElementAnimations Created 4 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_impl.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 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 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 AddOpacityTransitionToPlayer(player_child_.get(), 0.1, 5, 5, false); 1156 AddOpacityTransitionToPlayer(player_child_.get(), 0.1, 5, 5, false);
1157 break; 1157 break;
1158 } 1158 }
1159 } 1159 }
1160 1160
1161 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { 1161 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override {
1162 // After both animations have started, verify that they have valid 1162 // After both animations have started, verify that they have valid
1163 // start times. 1163 // start times.
1164 if (host_impl->active_tree()->source_frame_number() < 2) 1164 if (host_impl->active_tree()->source_frame_number() < 2)
1165 return; 1165 return;
1166 AnimationHost::LayerToElementAnimationsMap element_animations_copy = 1166 AnimationHost::ElementToAnimationsMap element_animations_copy =
1167 host_impl->animation_host()->active_element_animations_for_testing(); 1167 host_impl->animation_host()->active_element_animations_for_testing();
1168 EXPECT_EQ(2u, element_animations_copy.size()); 1168 EXPECT_EQ(2u, element_animations_copy.size());
1169 for (auto& it : element_animations_copy) { 1169 for (auto& it : element_animations_copy) {
1170 int id = it.first; 1170 int id = it.first;
1171 if (id == host_impl->RootLayer()->id()) { 1171 if (id == host_impl->RootLayer()->id()) {
1172 Animation* anim = it.second->GetAnimation(TargetProperty::TRANSFORM); 1172 Animation* anim = it.second->GetAnimation(TargetProperty::TRANSFORM);
1173 EXPECT_GT((anim->start_time() - base::TimeTicks()).InSecondsF(), 0); 1173 EXPECT_GT((anim->start_time() - base::TimeTicks()).InSecondsF(), 0);
1174 } else if (id == layer_->id()) { 1174 } else if (id == layer_->id()) {
1175 Animation* anim = it.second->GetAnimation(TargetProperty::OPACITY); 1175 Animation* anim = it.second->GetAnimation(TargetProperty::OPACITY);
1176 EXPECT_GT((anim->start_time() - base::TimeTicks()).InSecondsF(), 0); 1176 EXPECT_GT((anim->start_time() - base::TimeTicks()).InSecondsF(), 0);
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1600 private: 1600 private:
1601 scoped_refptr<Layer> layer_; 1601 scoped_refptr<Layer> layer_;
1602 FakeContentLayerClient client_; 1602 FakeContentLayerClient client_;
1603 }; 1603 };
1604 1604
1605 MULTI_THREAD_TEST_F( 1605 MULTI_THREAD_TEST_F(
1606 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); 1606 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit);
1607 1607
1608 } // namespace 1608 } // namespace
1609 } // namespace cc 1609 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698