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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGPathBlender.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) Research In Motion Limited 2010, 2011. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010, 2011. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 float progress) { 69 float progress) {
70 return FloatPoint(blend(a.x(), b.x(), progress), 70 return FloatPoint(blend(a.x(), b.x(), progress),
71 blend(a.y(), b.y(), progress)); 71 blend(a.y(), b.y(), progress));
72 } 72 }
73 73
74 float SVGPathBlender::BlendState::blendAnimatedDimensonalFloat( 74 float SVGPathBlender::BlendState::blendAnimatedDimensonalFloat(
75 float from, 75 float from,
76 float to, 76 float to,
77 FloatBlendMode blendMode) { 77 FloatBlendMode blendMode) {
78 if (m_addTypesCount) { 78 if (m_addTypesCount) {
79 ASSERT(m_typesAreEqual); 79 DCHECK(m_typesAreEqual);
80 return from + to * m_addTypesCount; 80 return from + to * m_addTypesCount;
81 } 81 }
82 82
83 if (m_typesAreEqual) 83 if (m_typesAreEqual)
84 return blend(from, to, m_progress); 84 return blend(from, to, m_progress);
85 85
86 float fromValue = blendMode == BlendHorizontal ? m_fromCurrentPoint.x() 86 float fromValue = blendMode == BlendHorizontal ? m_fromCurrentPoint.x()
87 : m_fromCurrentPoint.y(); 87 : m_fromCurrentPoint.y();
88 float toValue = blendMode == BlendHorizontal ? m_toCurrentPoint.x() 88 float toValue = blendMode == BlendHorizontal ? m_toCurrentPoint.x()
89 : m_toCurrentPoint.y(); 89 : m_toCurrentPoint.y();
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 updateCurrentPoint(m_fromSubPathPoint, m_fromCurrentPoint, fromSeg); 283 updateCurrentPoint(m_fromSubPathPoint, m_fromCurrentPoint, fromSeg);
284 updateCurrentPoint(m_toSubPathPoint, m_toCurrentPoint, toSeg); 284 updateCurrentPoint(m_toSubPathPoint, m_toCurrentPoint, toSeg);
285 285
286 return true; 286 return true;
287 } 287 }
288 288
289 SVGPathBlender::SVGPathBlender(SVGPathByteStreamSource* fromSource, 289 SVGPathBlender::SVGPathBlender(SVGPathByteStreamSource* fromSource,
290 SVGPathByteStreamSource* toSource, 290 SVGPathByteStreamSource* toSource,
291 SVGPathConsumer* consumer) 291 SVGPathConsumer* consumer)
292 : m_fromSource(fromSource), m_toSource(toSource), m_consumer(consumer) { 292 : m_fromSource(fromSource), m_toSource(toSource), m_consumer(consumer) {
293 ASSERT(m_fromSource); 293 DCHECK(m_fromSource);
294 ASSERT(m_toSource); 294 DCHECK(m_toSource);
295 ASSERT(m_consumer); 295 DCHECK(m_consumer);
296 } 296 }
297 297
298 bool SVGPathBlender::addAnimatedPath(unsigned repeatCount) { 298 bool SVGPathBlender::addAnimatedPath(unsigned repeatCount) {
299 BlendState blendState(0, repeatCount); 299 BlendState blendState(0, repeatCount);
300 return blendAnimatedPath(blendState); 300 return blendAnimatedPath(blendState);
301 } 301 }
302 302
303 bool SVGPathBlender::blendAnimatedPath(float progress) { 303 bool SVGPathBlender::blendAnimatedPath(float progress) {
304 BlendState blendState(progress); 304 BlendState blendState(progress);
305 return blendAnimatedPath(blendState); 305 return blendAnimatedPath(blendState);
(...skipping 23 matching lines...) Expand all
329 329
330 if (fromSourceIsEmpty) 330 if (fromSourceIsEmpty)
331 continue; 331 continue;
332 if (m_fromSource->hasMoreData() != m_toSource->hasMoreData()) 332 if (m_fromSource->hasMoreData() != m_toSource->hasMoreData())
333 return false; 333 return false;
334 } 334 }
335 return true; 335 return true;
336 } 336 }
337 337
338 } // namespace blink 338 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPath.cpp ('k') | third_party/WebKit/Source/core/svg/SVGPathByteStreamBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698