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

Side by Side Diff: Source/core/svg/SVGTransformDistance.cpp

Issue 183743004: Remove moar unused SVG methods (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/core/svg/SVGTransformDistance.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 return newTransform.release(); 186 return newTransform.release();
187 case SVG_TRANSFORM_SKEWY: 187 case SVG_TRANSFORM_SKEWY:
188 newTransform->setSkewY(transform->angle() + m_angle); 188 newTransform->setSkewY(transform->angle() + m_angle);
189 return newTransform.release(); 189 return newTransform.release();
190 } 190 }
191 191
192 ASSERT_NOT_REACHED(); 192 ASSERT_NOT_REACHED();
193 return newTransform.release(); 193 return newTransform.release();
194 } 194 }
195 195
196 bool SVGTransformDistance::isZero() const
197 {
198 return m_transform.isIdentity() && !m_angle;
199 }
200
201 float SVGTransformDistance::distance() const 196 float SVGTransformDistance::distance() const
202 { 197 {
203 switch (m_transformType) { 198 switch (m_transformType) {
204 case SVG_TRANSFORM_MATRIX: 199 case SVG_TRANSFORM_MATRIX:
205 ASSERT_NOT_REACHED(); 200 ASSERT_NOT_REACHED();
206 case SVG_TRANSFORM_UNKNOWN: 201 case SVG_TRANSFORM_UNKNOWN:
207 return 0; 202 return 0;
208 case SVG_TRANSFORM_ROTATE: 203 case SVG_TRANSFORM_ROTATE:
209 return sqrtf(m_angle * m_angle + m_cx * m_cx + m_cy * m_cy); 204 return sqrtf(m_angle * m_angle + m_cx * m_cx + m_cy * m_cy);
210 case SVG_TRANSFORM_SCALE: 205 case SVG_TRANSFORM_SCALE:
211 return static_cast<float>(sqrt(m_transform.a() * m_transform.a() + m_tra nsform.d() * m_transform.d())); 206 return static_cast<float>(sqrt(m_transform.a() * m_transform.a() + m_tra nsform.d() * m_transform.d()));
212 case SVG_TRANSFORM_TRANSLATE: 207 case SVG_TRANSFORM_TRANSLATE:
213 return static_cast<float>(sqrt(m_transform.e() * m_transform.e() + m_tra nsform.f() * m_transform.f())); 208 return static_cast<float>(sqrt(m_transform.e() * m_transform.e() + m_tra nsform.f() * m_transform.f()));
214 case SVG_TRANSFORM_SKEWX: 209 case SVG_TRANSFORM_SKEWX:
215 case SVG_TRANSFORM_SKEWY: 210 case SVG_TRANSFORM_SKEWY:
216 return m_angle; 211 return m_angle;
217 } 212 }
218 ASSERT_NOT_REACHED(); 213 ASSERT_NOT_REACHED();
219 return 0; 214 return 0;
220 } 215 }
221 216
222 } 217 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGTransformDistance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698