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

Unified Diff: Source/core/svg/animation/SMILTime.h

Issue 298043005: Improve comparison of intervals in SVGSMILElement::resolveFirstInterval (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/svg/animation/SVGSMILElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/animation/SMILTime.h
diff --git a/Source/core/svg/animation/SMILTime.h b/Source/core/svg/animation/SMILTime.h
index e572de3b38dd6465e8ebde4c0b1bb955082b623d..c5627d6e77e486d66a2db9ce1da576463ed82aae 100644
--- a/Source/core/svg/animation/SMILTime.h
+++ b/Source/core/svg/animation/SMILTime.h
@@ -80,6 +80,14 @@ private:
Origin m_origin;
};
+struct SMILInterval {
+ SMILInterval() { }
+ SMILInterval(const SMILTime& begin, const SMILTime& end) : begin(begin), end(end) { }
+
+ SMILTime begin;
+ SMILTime end;
+};
+
inline bool operator==(const SMILTime& a, const SMILTime& b) { return a.isFinite() && a.value() == b.value(); }
inline bool operator!(const SMILTime& a) { return !a.isFinite() || !a.value(); }
inline bool operator!=(const SMILTime& a, const SMILTime& b) { return !operator==(a, b); }
@@ -94,6 +102,13 @@ SMILTime operator-(const SMILTime&, const SMILTime&);
// So multiplying times does not make too much sense but SMIL defines it for duration * repeatCount
SMILTime operator*(const SMILTime&, const SMILTime&);
+inline bool operator!=(const SMILInterval& a, const SMILInterval& b)
+{
+ // Compare the "raw" values since the operator!= for SMILTime always return
pdr. 2014/05/28 21:56:24 Please file a bug about this. This is crazy: inlin
fs 2014/05/30 08:02:47 I'm not sure it's 100% crazy (maybe 84% crazy) - a
+ // true for non-finite times.
+ return a.begin.value() != b.begin.value() || a.end.value() != b.end.value();
+}
+
}
#endif // SMILTime_h
« no previous file with comments | « no previous file | Source/core/svg/animation/SVGSMILElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698