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

Side by Side Diff: Source/core/html/canvas/CanvasPathMethods.cpp

Issue 801053009: ASSERTION FAILED: newStartAngle >= 0 && newStartAngle < twoPiFloat. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | 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) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved.
9 * Copyright (C) 2012, 2013 Adobe Systems Incorporated. All rights reserved. 9 * Copyright (C) 2012, 2013 Adobe Systems Incorporated. All rights reserved.
10 * 10 *
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 172 }
173 173
174 inline FloatPoint getPointOnEllipse(float radiusX, float radiusY, float theta) 174 inline FloatPoint getPointOnEllipse(float radiusX, float radiusY, float theta)
175 { 175 {
176 return FloatPoint(radiusX * cosf(theta), radiusY * sinf(theta)); 176 return FloatPoint(radiusX * cosf(theta), radiusY * sinf(theta));
177 } 177 }
178 178
179 void canonicalizeAngle(float* startAngle, float* endAngle) 179 void canonicalizeAngle(float* startAngle, float* endAngle)
180 { 180 {
181 // Make 0 <= startAngle < 2*PI 181 // Make 0 <= startAngle < 2*PI
182 float newStartAngle = *startAngle; 182 float newStartAngle = fmodf(*startAngle, twoPiFloat);
183 if (newStartAngle < 0) 183 if (newStartAngle < 0)
184 newStartAngle = twoPiFloat + fmodf(newStartAngle, -twoPiFloat); 184 newStartAngle += twoPiFloat;
185 else
186 newStartAngle = fmodf(newStartAngle, twoPiFloat);
187 185
188 float delta = newStartAngle - *startAngle; 186 float delta = newStartAngle - *startAngle;
189 *startAngle = newStartAngle; 187 *startAngle = newStartAngle;
190 *endAngle = *endAngle + delta; 188 *endAngle = *endAngle + delta;
189
191 ASSERT(newStartAngle >= 0 && newStartAngle < twoPiFloat); 190 ASSERT(newStartAngle >= 0 && newStartAngle < twoPiFloat);
192 } 191 }
193 192
194 /* 193 /*
195 * degenerateEllipse() handles a degenerated ellipse using several lines. 194 * degenerateEllipse() handles a degenerated ellipse using several lines.
196 * 195 *
197 * Let's see a following example: line to ellipse to line. 196 * Let's see a following example: line to ellipse to line.
198 * _--^\ 197 * _--^\
199 * ( ) 198 * ( )
200 * -----( ) 199 * -----( )
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 return; 311 return;
313 312
314 if (!width && !height) { 313 if (!width && !height) {
315 m_path.moveTo(FloatPoint(x, y)); 314 m_path.moveTo(FloatPoint(x, y));
316 return; 315 return;
317 } 316 }
318 317
319 m_path.addRect(FloatRect(x, y, width, height)); 318 m_path.addRect(FloatRect(x, y, width, height));
320 } 319 }
321 } 320 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698