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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGTransformDistance.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) 2007 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
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 25 matching lines...) Expand all
36 : m_transformType(transformType), 36 : m_transformType(transformType),
37 m_angle(angle), 37 m_angle(angle),
38 m_cx(cx), 38 m_cx(cx),
39 m_cy(cy), 39 m_cy(cy),
40 m_transform(transform) {} 40 m_transform(transform) {}
41 41
42 SVGTransformDistance::SVGTransformDistance(SVGTransform* fromSVGTransform, 42 SVGTransformDistance::SVGTransformDistance(SVGTransform* fromSVGTransform,
43 SVGTransform* toSVGTransform) 43 SVGTransform* toSVGTransform)
44 : m_angle(0), m_cx(0), m_cy(0) { 44 : m_angle(0), m_cx(0), m_cy(0) {
45 m_transformType = fromSVGTransform->transformType(); 45 m_transformType = fromSVGTransform->transformType();
46 ASSERT(m_transformType == toSVGTransform->transformType()); 46 DCHECK_EQ(m_transformType, toSVGTransform->transformType());
47 47
48 switch (m_transformType) { 48 switch (m_transformType) {
49 case kSvgTransformMatrix: 49 case kSvgTransformMatrix:
50 ASSERT_NOT_REACHED(); 50 ASSERT_NOT_REACHED();
51 case kSvgTransformUnknown: 51 case kSvgTransformUnknown:
52 break; 52 break;
53 case kSvgTransformRotate: { 53 case kSvgTransformRotate: {
54 FloatSize centerDistance = 54 FloatSize centerDistance =
55 toSVGTransform->rotationCenter() - fromSVGTransform->rotationCenter(); 55 toSVGTransform->rotationCenter() - fromSVGTransform->rotationCenter();
56 m_angle = toSVGTransform->angle() - fromSVGTransform->angle(); 56 m_angle = toSVGTransform->angle() - fromSVGTransform->angle();
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 AffineTransform()); 108 AffineTransform());
109 } 109 }
110 110
111 ASSERT_NOT_REACHED(); 111 ASSERT_NOT_REACHED();
112 return SVGTransformDistance(); 112 return SVGTransformDistance();
113 } 113 }
114 114
115 SVGTransform* SVGTransformDistance::addSVGTransforms(SVGTransform* first, 115 SVGTransform* SVGTransformDistance::addSVGTransforms(SVGTransform* first,
116 SVGTransform* second, 116 SVGTransform* second,
117 unsigned repeatCount) { 117 unsigned repeatCount) {
118 ASSERT(first->transformType() == second->transformType()); 118 DCHECK_EQ(first->transformType(), second->transformType());
119 119
120 SVGTransform* transform = SVGTransform::create(); 120 SVGTransform* transform = SVGTransform::create();
121 121
122 switch (first->transformType()) { 122 switch (first->transformType()) {
123 case kSvgTransformMatrix: 123 case kSvgTransformMatrix:
124 ASSERT_NOT_REACHED(); 124 ASSERT_NOT_REACHED();
125 case kSvgTransformUnknown: 125 case kSvgTransformUnknown:
126 return transform; 126 return transform;
127 case kSvgTransformRotate: { 127 case kSvgTransformRotate: {
128 transform->setRotate(first->angle() + second->angle() * repeatCount, 128 transform->setRotate(first->angle() + second->angle() * repeatCount,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 m_transform.f() * m_transform.f())); 215 m_transform.f() * m_transform.f()));
216 case kSvgTransformSkewx: 216 case kSvgTransformSkewx:
217 case kSvgTransformSkewy: 217 case kSvgTransformSkewy:
218 return m_angle; 218 return m_angle;
219 } 219 }
220 ASSERT_NOT_REACHED(); 220 ASSERT_NOT_REACHED();
221 return 0; 221 return 0;
222 } 222 }
223 223
224 } // namespace blink 224 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGTransform.cpp ('k') | third_party/WebKit/Source/core/svg/SVGTransformList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698