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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGIntegerOptionalInteger.cpp

Issue 2738863002: Replace ASSERT with DCHECK in core/svg/ (Closed)
Patch Set: Split DCHECKS wherever possible Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 95
96 void SVGIntegerOptionalInteger::calculateAnimatedValue( 96 void SVGIntegerOptionalInteger::calculateAnimatedValue(
97 SVGAnimationElement* animationElement, 97 SVGAnimationElement* animationElement,
98 float percentage, 98 float percentage,
99 unsigned repeatCount, 99 unsigned repeatCount,
100 SVGPropertyBase* from, 100 SVGPropertyBase* from,
101 SVGPropertyBase* to, 101 SVGPropertyBase* to,
102 SVGPropertyBase* toAtEndOfDuration, 102 SVGPropertyBase* toAtEndOfDuration,
103 SVGElement*) { 103 SVGElement*) {
104 ASSERT(animationElement); 104 DCHECK(animationElement);
105 105
106 SVGIntegerOptionalInteger* fromInteger = toSVGIntegerOptionalInteger(from); 106 SVGIntegerOptionalInteger* fromInteger = toSVGIntegerOptionalInteger(from);
107 SVGIntegerOptionalInteger* toInteger = toSVGIntegerOptionalInteger(to); 107 SVGIntegerOptionalInteger* toInteger = toSVGIntegerOptionalInteger(to);
108 SVGIntegerOptionalInteger* toAtEndOfDurationInteger = 108 SVGIntegerOptionalInteger* toAtEndOfDurationInteger =
109 toSVGIntegerOptionalInteger(toAtEndOfDuration); 109 toSVGIntegerOptionalInteger(toAtEndOfDuration);
110 110
111 float x = m_firstInteger->value(); 111 float x = m_firstInteger->value();
112 float y = m_secondInteger->value(); 112 float y = m_secondInteger->value();
113 animationElement->animateAdditiveNumber( 113 animationElement->animateAdditiveNumber(
114 percentage, repeatCount, fromInteger->firstInteger()->value(), 114 percentage, repeatCount, fromInteger->firstInteger()->value(),
115 toInteger->firstInteger()->value(), 115 toInteger->firstInteger()->value(),
116 toAtEndOfDurationInteger->firstInteger()->value(), x); 116 toAtEndOfDurationInteger->firstInteger()->value(), x);
117 animationElement->animateAdditiveNumber( 117 animationElement->animateAdditiveNumber(
118 percentage, repeatCount, fromInteger->secondInteger()->value(), 118 percentage, repeatCount, fromInteger->secondInteger()->value(),
119 toInteger->secondInteger()->value(), 119 toInteger->secondInteger()->value(),
120 toAtEndOfDurationInteger->secondInteger()->value(), y); 120 toAtEndOfDurationInteger->secondInteger()->value(), y);
121 m_firstInteger->setValue(clampTo<int>(roundf(x))); 121 m_firstInteger->setValue(clampTo<int>(roundf(x)));
122 m_secondInteger->setValue(clampTo<int>(roundf(y))); 122 m_secondInteger->setValue(clampTo<int>(roundf(y)));
123 } 123 }
124 124
125 float SVGIntegerOptionalInteger::calculateDistance(SVGPropertyBase* other, 125 float SVGIntegerOptionalInteger::calculateDistance(SVGPropertyBase* other,
126 SVGElement*) { 126 SVGElement*) {
127 // FIXME: Distance calculation is not possible for SVGIntegerOptionalInteger 127 // FIXME: Distance calculation is not possible for SVGIntegerOptionalInteger
128 // right now. We need the distance for every single value. 128 // right now. We need the distance for every single value.
129 return -1; 129 return -1;
130 } 130 }
131 131
132 } // namespace blink 132 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGInteger.cpp ('k') | third_party/WebKit/Source/core/svg/SVGLength.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698