Bug 1361663 - Part 1: Use double instead of float for the progress of interpolation. draft
authorBoris Chiou <boris.chiou@gmail.com>
Mon, 22 May 2017 13:35:15 +0800
changeset 583611 a1f70ce9f05a2b9f10b47ff821256a01c2e15575
parent 583335 96e18bec9fc8a5ce623c16167c12756bbe190d73
child 583612 69c8f1a84f870129fc1bf5a8740c957a2fa6269e
child 583616 fdd7754523ba85ca9eb4e4539f61c8f1f78ac928
child 583623 e51a9ffcfc93604451e2ca6143a6b93bac26cf4a
push id60467
push userbmo:boris.chiou@gmail.com
push dateWed, 24 May 2017 09:22:46 +0000
bugs1361663
milestone55.0a1
Bug 1361663 - Part 1: Use double instead of float for the progress of interpolation. We get the progress as |double|, and then pass it to a function by a |float| type, and then finally cast it back to |double| for the interpolation. We should avoid casting it back and forth, so change the function argument to use |double| type for the progress. MozReview-Commit-ID: 7QzfVBC7hSt
gfx/layers/AnimationHelper.cpp
--- a/gfx/layers/AnimationHelper.cpp
+++ b/gfx/layers/AnimationHelper.cpp
@@ -92,17 +92,17 @@ void
 CompositorAnimationStorage::SetAnimations(uint64_t aId, const AnimationArray& aValue)
 {
   MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
   AnimationArray* value = new AnimationArray(aValue);
   mAnimations.Put(aId, value);
 }
 
 static StyleAnimationValue
-SampleValue(float aPortion, const layers::Animation& aAnimation,
+SampleValue(double aPortion, const layers::Animation& aAnimation,
             const StyleAnimationValueCompositePair& aStart,
             const StyleAnimationValueCompositePair& aEnd,
             const StyleAnimationValue& aLastValue,
             uint64_t aCurrentIteration,
             const StyleAnimationValue& aUnderlyingValue)
 {
   NS_ASSERTION(aStart.mValue.IsNull() || aEnd.mValue.IsNull() ||
                aStart.mValue.GetUnit() == aEnd.mValue.GetUnit(),