servo: Merge #6894 - style: Switch animation timestamps to be doubles instead of floats (from pcwalton:double-precision-timestamps); r=metajack

32-bit floats are not enough to hold timestamps since the epoch and
result in jank.

r? @metajack

Source-Repo: https://github.com/servo/servo
Source-Revision: 92cbb9368471d12f0d5492abd7e04b16df549366
This commit is contained in:
Patrick Walton
2015-08-01 22:01:39 -06:00
parent 5698c2dc64
commit d363ed08c8
4 changed files with 60 additions and 57 deletions

View File

@@ -208,15 +208,15 @@ pub struct Animation {
/// A description of the property animation that is occurring.
pub property_animation: PropertyAnimation,
/// The start time of the animation, as returned by `time::precise_time_s()`.
pub start_time: f32,
pub start_time: f64,
/// The end time of the animation, as returned by `time::precise_time_s()`.
pub end_time: f32,
pub end_time: f64,
}
impl Animation {
/// Returns the duration of this animation in seconds.
#[inline]
pub fn duration(&self) -> f32 {
pub fn duration(&self) -> f64 {
self.end_time - self.start_time
}
}