Index: Source/core/animation/AnimationClock.cpp |
diff --git a/Source/core/svg/SVGAnimatedNumber.cpp b/Source/core/animation/AnimationClock.cpp |
similarity index 77% |
copy from Source/core/svg/SVGAnimatedNumber.cpp |
copy to Source/core/animation/AnimationClock.cpp |
index 9c1fc971a5258560fec9bd76b7e2576de468a062..649220690e67a27adf18592ac5d9a46d000c9ff2 100644 |
--- a/Source/core/svg/SVGAnimatedNumber.cpp |
+++ b/Source/core/animation/AnimationClock.cpp |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright (C) 2014 Google Inc. All rights reserved. |
+ * Copyright (c) 2014, Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -29,21 +29,25 @@ |
*/ |
#include "config.h" |
- |
-#include "core/svg/SVGAnimatedNumber.h" |
-#include "core/svg/SVGAnimatedNumberOptionalNumber.h" |
+#include "core/animation/AnimationClock.h" |
namespace WebCore { |
-void SVGAnimatedNumber::synchronizeAttribute() |
+void AnimationClock::updateTime(double time) |
{ |
- ASSERT(needsSynchronizeAttribute()); |
- if (m_parentNumberOptionalNumber) { |
- m_parentNumberOptionalNumber->synchronizeAttribute(); |
- return; |
- } |
+ if (time > m_time) |
+ m_time = time; |
+ m_frozen = true; |
+} |
- NewSVGAnimatedProperty<SVGNumber>::synchronizeAttribute(); |
+double AnimationClock::currentTime() |
+{ |
+ if (!m_frozen) { |
+ double newTime = m_monotonicallyIncreasingTime(); |
+ if (newTime >= m_time + minTimeBeforeUnsynchronizedAnimationClockTick) |
+ m_time = newTime; |
+ } |
+ return m_time; |
} |
} |