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

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

Issue 2040543002: Take MT jank into account when animating the scroll offset on CC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test + apply suggested improvement Created 4 years, 3 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_unittest.cc ('k') | ui/events/blink/input_handler_proxy.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 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 ->animation_host() 794 ->animation_host()
795 ->scroll_offset_animations() 795 ->scroll_offset_animations()
796 .HasUpdatesForTesting()); 796 .HasUpdatesForTesting());
797 } 797 }
798 } 798 }
799 799
800 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { 800 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
801 if (host_impl->sync_tree()->source_frame_number() == 0) { 801 if (host_impl->sync_tree()->source_frame_number() == 0) {
802 host_impl->animation_host()->ImplOnlyScrollAnimationCreate( 802 host_impl->animation_host()->ImplOnlyScrollAnimationCreate(
803 scroll_layer_->element_id(), gfx::ScrollOffset(650.f, 750.f), 803 scroll_layer_->element_id(), gfx::ScrollOffset(650.f, 750.f),
804 gfx::ScrollOffset(10, 20)); 804 gfx::ScrollOffset(10, 20), base::TimeDelta());
805 } 805 }
806 } 806 }
807 807
808 void NotifyAnimationTakeover(base::TimeTicks monotonic_time, 808 void NotifyAnimationTakeover(base::TimeTicks monotonic_time,
809 TargetProperty::Type target_property, 809 TargetProperty::Type target_property,
810 double animation_start_time, 810 double animation_start_time,
811 std::unique_ptr<AnimationCurve> curve) override { 811 std::unique_ptr<AnimationCurve> curve) override {
812 EndTest(); 812 EndTest();
813 } 813 }
814 814
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 EXPECT_EQ(gfx::ScrollOffset(10.f, 20.f), 884 EXPECT_EQ(gfx::ScrollOffset(10.f, 20.f),
885 curve->GetValue(base::TimeDelta())); 885 curve->GetValue(base::TimeDelta()));
886 EXPECT_EQ(gfx::ScrollOffset(650.f, 750.f), curve->target_value()); 886 EXPECT_EQ(gfx::ScrollOffset(650.f, 750.f), curve->target_value());
887 } 887 }
888 } 888 }
889 889
890 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { 890 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
891 if (host_impl->sync_tree()->source_frame_number() == 0) { 891 if (host_impl->sync_tree()->source_frame_number() == 0) {
892 host_impl->animation_host()->ImplOnlyScrollAnimationCreate( 892 host_impl->animation_host()->ImplOnlyScrollAnimationCreate(
893 scroll_layer_->element_id(), gfx::ScrollOffset(650.f, 750.f), 893 scroll_layer_->element_id(), gfx::ScrollOffset(650.f, 750.f),
894 gfx::ScrollOffset(10, 20)); 894 gfx::ScrollOffset(10, 20), base::TimeDelta());
895 } 895 }
896 } 896 }
897 897
898 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { 898 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
899 if (host_impl->sync_tree()->source_frame_number() == 1) { 899 if (host_impl->sync_tree()->source_frame_number() == 1) {
900 Animation* animation = 900 Animation* animation =
901 host_impl->animation_host() 901 host_impl->animation_host()
902 ->GetElementAnimationsForElementId(scroll_layer_->element_id()) 902 ->GetElementAnimationsForElementId(scroll_layer_->element_id())
903 ->GetAnimation(TargetProperty::SCROLL_OFFSET); 903 ->GetAnimation(TargetProperty::SCROLL_OFFSET);
904 ScrollOffsetAnimationCurve* curve = 904 ScrollOffsetAnimationCurve* curve =
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
1856 private: 1856 private:
1857 scoped_refptr<Layer> layer_; 1857 scoped_refptr<Layer> layer_;
1858 FakeContentLayerClient client_; 1858 FakeContentLayerClient client_;
1859 }; 1859 };
1860 1860
1861 MULTI_THREAD_TEST_F( 1861 MULTI_THREAD_TEST_F(
1862 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); 1862 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit);
1863 1863
1864 } // namespace 1864 } // namespace
1865 } // namespace cc 1865 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | ui/events/blink/input_handler_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698