| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |