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

Side by Side Diff: cc/animation/animation_host_unittest.cc

Issue 2863103002: Reduce composited smooth scroll latency by a frame (also fixes latency UMAs). (Closed)
Patch Set: Cleanup. Created 3 years, 7 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/animation/animation_host.cc ('k') | cc/animation/scroll_offset_animations_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/animation/animation_host.h" 5 #include "cc/animation/animation_host.h"
6 6
7 #include "cc/animation/animation_id_provider.h" 7 #include "cc/animation/animation_id_provider.h"
8 #include "cc/animation/animation_timeline.h" 8 #include "cc/animation/animation_timeline.h"
9 #include "cc/test/animation_test_common.h" 9 #include "cc/test/animation_test_common.h"
10 #include "cc/test/animation_timelines_test_common.h" 10 #include "cc/test/animation_timelines_test_common.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 EXPECT_TRUE(host_impl->GetTimelineById(timeline_id2)); 80 EXPECT_TRUE(host_impl->GetTimelineById(timeline_id2));
81 } 81 }
82 82
83 TEST_F(AnimationHostTest, ImplOnlyScrollAnimationUpdateTargetIfDetached) { 83 TEST_F(AnimationHostTest, ImplOnlyScrollAnimationUpdateTargetIfDetached) {
84 client_.RegisterElement(element_id_, ElementListType::ACTIVE); 84 client_.RegisterElement(element_id_, ElementListType::ACTIVE);
85 client_impl_.RegisterElement(element_id_, ElementListType::PENDING); 85 client_impl_.RegisterElement(element_id_, ElementListType::PENDING);
86 86
87 gfx::ScrollOffset target_offset(0., 2.); 87 gfx::ScrollOffset target_offset(0., 2.);
88 gfx::ScrollOffset current_offset(0., 1.); 88 gfx::ScrollOffset current_offset(0., 1.);
89 host_impl_->ImplOnlyScrollAnimationCreate(element_id_, target_offset, 89 host_impl_->ImplOnlyScrollAnimationCreate(element_id_, target_offset,
90 current_offset, base::TimeDelta()); 90 current_offset, base::TimeDelta(),
91 base::TimeDelta());
91 92
92 gfx::Vector2dF scroll_delta(0, 0.5); 93 gfx::Vector2dF scroll_delta(0, 0.5);
93 gfx::ScrollOffset max_scroll_offset(0., 3.); 94 gfx::ScrollOffset max_scroll_offset(0., 3.);
94 95
95 base::TimeTicks time; 96 base::TimeTicks time;
96 97
97 time += base::TimeDelta::FromSecondsD(0.1); 98 time += base::TimeDelta::FromSecondsD(0.1);
98 EXPECT_TRUE(host_impl_->ImplOnlyScrollAnimationUpdateTarget( 99 EXPECT_TRUE(host_impl_->ImplOnlyScrollAnimationUpdateTarget(
99 element_id_, scroll_delta, max_scroll_offset, time, base::TimeDelta())); 100 element_id_, scroll_delta, max_scroll_offset, time, base::TimeDelta()));
100 101
101 // Detach all players from layers and timelines. 102 // Detach all players from layers and timelines.
102 host_impl_->ClearMutators(); 103 host_impl_->ClearMutators();
103 104
104 time += base::TimeDelta::FromSecondsD(0.1); 105 time += base::TimeDelta::FromSecondsD(0.1);
105 EXPECT_FALSE(host_impl_->ImplOnlyScrollAnimationUpdateTarget( 106 EXPECT_FALSE(host_impl_->ImplOnlyScrollAnimationUpdateTarget(
106 element_id_, scroll_delta, max_scroll_offset, time, base::TimeDelta())); 107 element_id_, scroll_delta, max_scroll_offset, time, base::TimeDelta()));
107 } 108 }
108 109
109 } // namespace 110 } // namespace
110 } // namespace cc 111 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/animation_host.cc ('k') | cc/animation/scroll_offset_animations_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698