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

Issue 231133002: CC::Animations should use TimeTicks & TimeDelta to represent time (Closed)

Created:
6 years, 8 months ago by Sikugu_
Modified:
6 years, 7 months ago
CC:
chromium-reviews, cc-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

CC::LayerAnimationController should use TimeTicks and TimeDelta to represent time. As of now complete CC/animation code uses double type for time durations. This patch replaces double with TimeTicks where time stamps is used and TimeDeltas where offset is used. BUG=178171 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=270718

Patch Set 1 #

Total comments: 18

Patch Set 2 : Code changed as per the comments. #

Patch Set 3 : Change GetTimedelta #

Patch Set 4 : Rebasing TOT. #

Total comments: 6

Patch Set 5 : Adding Animation related changes and unittests #

Total comments: 8

Patch Set 6 : Refactored code as per the comments. #

Patch Set 7 : Code Refactored as per the comments. #

Total comments: 36

Patch Set 8 : Fixed unittest failures. #

Patch Set 9 : Self review changes. #

Total comments: 13

Patch Set 10 : Code changed as per review comments. #

Total comments: 45

Patch Set 11 : Code changed as per the review comments. #

Patch Set 12 : Rebasing TOT! #

Patch Set 13 : Rebasing TOT! #

Patch Set 14 : Fix for build errors in ui/compositor unittests. #

Total comments: 13

Patch Set 15 : Updated code as per the comments. #

Total comments: 2

Patch Set 16 : Code changed as per review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+559 lines, -508 lines) Patch
M cc/animation/animation.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +21 lines, -14 lines 0 comments Download
M cc/animation/animation.cc View 1 2 3 4 5 6 7 8 9 10 8 chunks +26 lines, -27 lines 0 comments Download
M cc/animation/animation_events.h View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cc/animation/animation_events.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M cc/animation/animation_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +217 lines, -207 lines 0 comments Download
M cc/animation/layer_animation_controller.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +9 lines, -9 lines 0 comments Download
M cc/animation/layer_animation_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 14 chunks +16 lines, -20 lines 0 comments Download
M cc/animation/layer_animation_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 55 chunks +133 lines, -95 lines 0 comments Download
M cc/animation/scroll_offset_animation_curve.h View 1 2 3 4 5 2 chunks +2 lines, -1 line 0 comments Download
M cc/animation/scroll_offset_animation_curve.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +10 lines, -7 lines 0 comments Download
M cc/input/page_scale_animation.h View 1 2 3 4 5 6 7 8 9 4 chunks +12 lines, -10 lines 0 comments Download
M cc/input/page_scale_animation.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +23 lines, -20 lines 0 comments Download
M cc/layers/layer.cc View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -1 line 0 comments Download
M cc/trees/layer_tree_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -3 lines 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +8 lines, -18 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_animation.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +6 lines, -4 lines 0 comments Download
M ui/compositor/layer_animation_sequence.cc View 1 2 3 4 1 chunk +1 line, -3 lines 0 comments Download
M ui/compositor/layer_animation_sequence_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +18 lines, -18 lines 0 comments Download
M ui/compositor/layer_animator.cc View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M ui/compositor/layer_animator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 12 chunks +36 lines, -36 lines 0 comments Download
M ui/compositor/test/layer_animator_test_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +6 lines, -6 lines 0 comments Download
M webkit/renderer/compositor_bindings/web_animation_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +7 lines, -4 lines 0 comments Download

Messages

Total messages: 40 (0 generated)
Sikugu_
PTAL.. I have split the patch into 2 patches. This takes care of LayerAnimationController api ...
6 years, 8 months ago (2014-04-09 16:17:26 UTC) #1
danakj
https://codereview.chromium.org/231133002/diff/1/cc/animation/layer_animation_controller.cc File cc/animation/layer_animation_controller.cc (right): https://codereview.chromium.org/231133002/diff/1/cc/animation/layer_animation_controller.cc#newcode292 cc/animation/layer_animation_controller.cc:292: whitespace? https://codereview.chromium.org/231133002/diff/1/cc/animation/layer_animation_controller.cc#newcode297 cc/animation/layer_animation_controller.cc:297: whitespace? https://codereview.chromium.org/231133002/diff/1/cc/animation/layer_animation_controller.h File cc/animation/layer_animation_controller.h (right): https://codereview.chromium.org/231133002/diff/1/cc/animation/layer_animation_controller.h#newcode137 ...
6 years, 8 months ago (2014-04-09 16:33:03 UTC) #2
danakj
https://codereview.chromium.org/231133002/diff/1/cc/layers/layer.cc File cc/layers/layer.cc (right): https://codereview.chromium.org/231133002/diff/1/cc/layers/layer.cc#newcode1123 cc/layers/layer.cc:1123: base::TimeTicks::FromInternalValue(time_offset * Is converting back and forth from double ...
6 years, 8 months ago (2014-04-09 16:34:14 UTC) #3
ajuma
https://codereview.chromium.org/231133002/diff/1/cc/animation/layer_animation_controller.h File cc/animation/layer_animation_controller.h (right): https://codereview.chromium.org/231133002/diff/1/cc/animation/layer_animation_controller.h#newcode43 cc/animation/layer_animation_controller.h:43: void PauseAnimation(int animation_id, base::TimeTicks time_offset); An offset seems more ...
6 years, 8 months ago (2014-04-09 17:37:39 UTC) #4
Sikugu_
3 scrolloffset tests of layeranimation got failed when running the cc_unittests, this is because of ...
6 years, 8 months ago (2014-04-10 14:04:57 UTC) #5
ajuma
On 2014/04/10 14:04:57, Sikugu_ wrote: > 3 scrolloffset tests of layeranimation got failed when running ...
6 years, 8 months ago (2014-04-10 14:26:59 UTC) #6
Sikugu_
On 2014/04/10 14:26:59, ajuma wrote: > On 2014/04/10 14:04:57, Sikugu_ wrote: > > 3 scrolloffset ...
6 years, 8 months ago (2014-04-10 14:32:13 UTC) #7
ajuma
On 2014/04/10 14:32:13, Sikugu_ wrote: > On 2014/04/10 14:26:59, ajuma wrote: > > On 2014/04/10 ...
6 years, 8 months ago (2014-04-10 14:41:33 UTC) #8
mithro-old
On 2014/04/10 14:41:33, ajuma wrote: > On 2014/04/10 14:32:13, Sikugu_ wrote: > > On 2014/04/10 ...
6 years, 8 months ago (2014-04-16 00:44:23 UTC) #9
mithro-old
https://codereview.chromium.org/231133002/diff/80001/cc/animation/layer_animation_controller_unittest.cc File cc/animation/layer_animation_controller_unittest.cc (right): https://codereview.chromium.org/231133002/diff/80001/cc/animation/layer_animation_controller_unittest.cc#newcode23 cc/animation/layer_animation_controller_unittest.cc:23: base::TimeTicks GetTimeTicks(double time) { A better name is "double ...
6 years, 8 months ago (2014-04-16 13:33:17 UTC) #10
tomhudson
> Why didn't you just do; > ----------------------------------- > base::TimeTicks::FromMilliseconds(500); > ----------------------------------- Every call to ...
6 years, 8 months ago (2014-04-16 14:03:57 UTC) #11
mithro-old
On 2014/04/16 14:03:57, tomhudson wrote: > > Why didn't you just do; > > ----------------------------------- ...
6 years, 8 months ago (2014-04-16 14:13:12 UTC) #12
tomhudson
Sorry, you're right, I was thinking of TimeDelta::InMillisecondsF() and InSecondsF().
6 years, 8 months ago (2014-04-16 14:26:43 UTC) #13
danakj
https://codereview.chromium.org/231133002/diff/80001/cc/animation/layer_animation_controller_unittest.cc File cc/animation/layer_animation_controller_unittest.cc (right): https://codereview.chromium.org/231133002/diff/80001/cc/animation/layer_animation_controller_unittest.cc#newcode103 cc/animation/layer_animation_controller_unittest.cc:103: controller->Animate(kInitialTickTime + GetTimeDelta(0.5)); On 2014/04/16 13:33:17, mithro wrote: > ...
6 years, 8 months ago (2014-04-16 15:06:58 UTC) #14
Sikugu_
Hi Mithro, Danakj, tomhudson Sorry i was on leave last week. I checked your comments. ...
6 years, 8 months ago (2014-04-21 14:19:41 UTC) #15
Sikugu_
PTAL at the refactoring.. This is an WIP. One test case is failing as below. ...
6 years, 8 months ago (2014-04-24 15:19:30 UTC) #16
ajuma
https://codereview.chromium.org/231133002/diff/120001/base/time/time.h File base/time/time.h (right): https://codereview.chromium.org/231133002/diff/120001/base/time/time.h#newcode679 base/time/time.h:679: } It's not obvious to me whether these are ...
6 years, 8 months ago (2014-04-24 20:41:35 UTC) #17
Sikugu_
PTAL.. All unittests are passed now. https://codereview.chromium.org/231133002/diff/120001/cc/animation/animation.cc File cc/animation/animation.cc (right): https://codereview.chromium.org/231133002/diff/120001/cc/animation/animation.cc#newcode67 cc/animation/animation.cc:67: start_time_(base::TimeTicks()), On 2014/04/24 ...
6 years, 7 months ago (2014-05-05 07:09:18 UTC) #18
ajuma
Thanks, this is getting a lot closer. https://codereview.chromium.org/231133002/diff/120001/cc/animation/animation.cc File cc/animation/animation.cc (right): https://codereview.chromium.org/231133002/diff/120001/cc/animation/animation.cc#newcode155 cc/animation/animation.cc:155: base::TimeTicks::InSecondsF((monotonic_time + ...
6 years, 7 months ago (2014-05-05 15:13:31 UTC) #19
Sikugu_
PTAL.. https://codereview.chromium.org/231133002/diff/120001/cc/animation/animation.cc File cc/animation/animation.cc (right): https://codereview.chromium.org/231133002/diff/120001/cc/animation/animation.cc#newcode155 cc/animation/animation.cc:155: base::TimeTicks::InSecondsF((monotonic_time + time_offset_) - On 2014/05/05 15:13:32, ajuma ...
6 years, 7 months ago (2014-05-07 14:49:06 UTC) #20
ajuma
Please make sure this passes try jobs. Pay special attention to cc_unittests (looks like you've ...
6 years, 7 months ago (2014-05-07 17:04:41 UTC) #21
ajuma
https://codereview.chromium.org/231133002/diff/180001/cc/input/page_scale_animation.cc File cc/input/page_scale_animation.cc (right): https://codereview.chromium.org/231133002/diff/180001/cc/input/page_scale_animation.cc#newcode171 cc/input/page_scale_animation.cc:171: return (start_time_ - base::TimeTicks()).InSecondsF() >= 0; On 2014/05/07 17:04:42, ...
6 years, 7 months ago (2014-05-07 17:06:49 UTC) #22
Sikugu_
PTAL.. https://codereview.chromium.org/231133002/diff/180001/cc/animation/animation.cc File cc/animation/animation.cc (right): https://codereview.chromium.org/231133002/diff/180001/cc/animation/animation.cc#newcode67 cc/animation/animation.cc:67: start_time_(), On 2014/05/07 17:04:42, ajuma wrote: > This ...
6 years, 7 months ago (2014-05-12 16:01:52 UTC) #23
ajuma
Thanks so much for patiently iterating on this. cc/ and ui/compositor lgtm. Please format your ...
6 years, 7 months ago (2014-05-12 18:12:10 UTC) #24
Sikugu_
Danakj, Piman, enne, aelias PTAL..
6 years, 7 months ago (2014-05-12 19:20:54 UTC) #25
piman
LGTM for ui/compositor if ajuma@ is happy.
6 years, 7 months ago (2014-05-12 20:07:02 UTC) #26
danakj
ditto from me rslgtm
6 years, 7 months ago (2014-05-12 22:31:31 UTC) #27
Sikugu_
@enne, nduca for webkit/renderer/compositor_bindings/ @aelias for cc/input PTAL..
6 years, 7 months ago (2014-05-13 04:32:25 UTC) #28
aelias_OOO_until_Jul13
https://codereview.chromium.org/231133002/diff/260001/cc/input/page_scale_animation.cc File cc/input/page_scale_animation.cc (right): https://codereview.chromium.org/231133002/diff/260001/cc/input/page_scale_animation.cc#newcode73 cc/input/page_scale_animation.cc:73: -1.0 * base::Time::kMicrosecondsPerSecond)), This default value is a bad ...
6 years, 7 months ago (2014-05-13 06:00:06 UTC) #29
aelias_OOO_until_Jul13
6 years, 7 months ago (2014-05-13 06:00:30 UTC) #30
mithro-old
Hi, A bunch of minor comments plus one big question about "double Animation::TrimTimeToCurrentIteration(". I haven't ...
6 years, 7 months ago (2014-05-13 09:25:30 UTC) #31
ajuma
https://codereview.chromium.org/231133002/diff/260001/cc/input/page_scale_animation.cc File cc/input/page_scale_animation.cc (right): https://codereview.chromium.org/231133002/diff/260001/cc/input/page_scale_animation.cc#newcode73 cc/input/page_scale_animation.cc:73: -1.0 * base::Time::kMicrosecondsPerSecond)), On 2014/05/13 06:00:07, aelias wrote: > ...
6 years, 7 months ago (2014-05-13 13:44:48 UTC) #32
Sikugu_
PTAL.. https://codereview.chromium.org/231133002/diff/260001/cc/animation/animation.cc File cc/animation/animation.cc (right): https://codereview.chromium.org/231133002/diff/260001/cc/animation/animation.cc#newcode157 cc/animation/animation.cc:157: double Animation::TrimTimeToCurrentIteration( I would like to change this ...
6 years, 7 months ago (2014-05-14 14:23:18 UTC) #33
ajuma
still lgtm, with one nit: https://codereview.chromium.org/231133002/diff/280001/cc/input/page_scale_animation.cc File cc/input/page_scale_animation.cc (right): https://codereview.chromium.org/231133002/diff/280001/cc/input/page_scale_animation.cc#newcode172 cc/input/page_scale_animation.cc:172: DCHECK(start_time_ <= base::TimeTicks()); This ...
6 years, 7 months ago (2014-05-14 14:49:49 UTC) #34
enne (OOO)
webkit/renderer/compositor_bindings lgtm
6 years, 7 months ago (2014-05-14 17:00:43 UTC) #35
aelias_OOO_until_Jul13
lgtm for cc/input modulo ajuma's nit (actually all of the other DCHECKs would be better ...
6 years, 7 months ago (2014-05-14 18:38:47 UTC) #36
Sikugu_
https://codereview.chromium.org/231133002/diff/280001/cc/input/page_scale_animation.cc File cc/input/page_scale_animation.cc (right): https://codereview.chromium.org/231133002/diff/280001/cc/input/page_scale_animation.cc#newcode172 cc/input/page_scale_animation.cc:172: DCHECK(start_time_ <= base::TimeTicks()); On 2014/05/14 14:49:49, ajuma wrote: > ...
6 years, 7 months ago (2014-05-15 08:41:22 UTC) #37
Sikugu_
The CQ bit was checked by sivagunturi@chromium.org
6 years, 7 months ago (2014-05-15 08:41:37 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sivagunturi@chromium.org/231133002/300001
6 years, 7 months ago (2014-05-15 08:42:27 UTC) #39
commit-bot: I haz the power
6 years, 7 months ago (2014-05-15 17:31:38 UTC) #40
Message was sent while issue was closed.
Change committed as 270718

Powered by Google App Engine
This is Rietveld 408576698