OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. |
3 * 2006 Rob Buis <buis@kde.org> | 3 * 2006 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2013 Google Inc. All rights reserved. | 5 * Copyright (C) 2013 Google Inc. All rights reserved. |
6 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 6 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 ASSERT(ellipseIsRenderable(startAngle, endAngle)); | 365 ASSERT(ellipseIsRenderable(startAngle, endAngle)); |
366 ASSERT(startAngle >= 0 && startAngle < twoPiFloat); | 366 ASSERT(startAngle >= 0 && startAngle < twoPiFloat); |
367 ASSERT((anticlockwise && (startAngle - endAngle) >= 0) || (!anticlockwise &&
(endAngle - startAngle) >= 0)); | 367 ASSERT((anticlockwise && (startAngle - endAngle) >= 0) || (!anticlockwise &&
(endAngle - startAngle) >= 0)); |
368 | 368 |
369 if (!rotation) { | 369 if (!rotation) { |
370 addEllipse(FloatPoint(p.x(), p.y()), radiusX, radiusY, startAngle, endAn
gle, anticlockwise); | 370 addEllipse(FloatPoint(p.x(), p.y()), radiusX, radiusY, startAngle, endAn
gle, anticlockwise); |
371 return; | 371 return; |
372 } | 372 } |
373 | 373 |
374 // Add an arc after the relevant transform. | 374 // Add an arc after the relevant transform. |
375 AffineTransform ellipseTransform = AffineTransform::translation(p.x(), p.y()
).rotate(rad2deg(rotation)); | 375 AffineTransform ellipseTransform = AffineTransform::translation(p.x(), p.y()
).rotateRadians(rotation); |
376 ASSERT(ellipseTransform.isInvertible()); | 376 ASSERT(ellipseTransform.isInvertible()); |
377 AffineTransform inverseEllipseTransform = ellipseTransform.inverse(); | 377 AffineTransform inverseEllipseTransform = ellipseTransform.inverse(); |
378 transform(inverseEllipseTransform); | 378 transform(inverseEllipseTransform); |
379 addEllipse(FloatPoint::zero(), radiusX, radiusY, startAngle, endAngle, antic
lockwise); | 379 addEllipse(FloatPoint::zero(), radiusX, radiusY, startAngle, endAngle, antic
lockwise); |
380 transform(ellipseTransform); | 380 transform(ellipseTransform); |
381 } | 381 } |
382 | 382 |
383 void Path::addEllipse(const FloatRect& rect) | 383 void Path::addEllipse(const FloatRect& rect) |
384 { | 384 { |
385 m_path.addOval(rect); | 385 m_path.addOval(rect); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 | 489 |
490 #if !ASSERT_DISABLED | 490 #if !ASSERT_DISABLED |
491 bool ellipseIsRenderable(float startAngle, float endAngle) | 491 bool ellipseIsRenderable(float startAngle, float endAngle) |
492 { | 492 { |
493 return (std::abs(endAngle - startAngle) < twoPiFloat) | 493 return (std::abs(endAngle - startAngle) < twoPiFloat) |
494 || WebCoreFloatNearlyEqual(std::abs(endAngle - startAngle), twoPiFloat); | 494 || WebCoreFloatNearlyEqual(std::abs(endAngle - startAngle), twoPiFloat); |
495 } | 495 } |
496 #endif | 496 #endif |
497 | 497 |
498 } | 498 } |
OLD | NEW |