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

Unified Diff: Source/platform/graphics/Path.cpp

Issue 170453004: Add constant twoPiDouble/twoPiFloat to MathExtras.h (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add constant values to header Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/audio/UpSampler.cpp ('k') | Source/platform/graphics/filters/FEGaussianBlur.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/Path.cpp
diff --git a/Source/platform/graphics/Path.cpp b/Source/platform/graphics/Path.cpp
index 3671bcf6c71d020204d7b2eca7a2999f3dccd395..633b64eee665bf117b6e682efc42db8e73fd5064 100644
--- a/Source/platform/graphics/Path.cpp
+++ b/Source/platform/graphics/Path.cpp
@@ -315,7 +315,7 @@ void Path::closeSubpath()
void Path::addEllipse(const FloatPoint& p, float radiusX, float radiusY, float startAngle, float endAngle, bool anticlockwise)
{
ASSERT(ellipseIsRenderable(startAngle, endAngle));
- ASSERT(startAngle >= 0 && startAngle < 2 * piFloat);
+ ASSERT(startAngle >= 0 && startAngle < twoPiFloat);
ASSERT((anticlockwise && (startAngle - endAngle) >= 0) || (!anticlockwise && (endAngle - startAngle) >= 0));
SkScalar cx = WebCoreFloatToSkScalar(p.x());
@@ -363,7 +363,7 @@ void Path::addRect(const FloatRect& rect)
void Path::addEllipse(const FloatPoint& p, float radiusX, float radiusY, float rotation, float startAngle, float endAngle, bool anticlockwise)
{
ASSERT(ellipseIsRenderable(startAngle, endAngle));
- ASSERT(startAngle >= 0 && startAngle < 2 * piFloat);
+ ASSERT(startAngle >= 0 && startAngle < twoPiFloat);
ASSERT((anticlockwise && (startAngle - endAngle) >= 0) || (!anticlockwise && (endAngle - startAngle) >= 0));
if (!rotation) {
@@ -485,8 +485,8 @@ bool Path::unionPath(const Path& other)
#if !ASSERT_DISABLED
bool ellipseIsRenderable(float startAngle, float endAngle)
{
- return (std::abs(endAngle - startAngle) < 2 * piFloat)
- || WebCoreFloatNearlyEqual(std::abs(endAngle - startAngle), 2 * piFloat);
+ return (std::abs(endAngle - startAngle) < twoPiFloat)
+ || WebCoreFloatNearlyEqual(std::abs(endAngle - startAngle), twoPiFloat);
}
#endif
« no previous file with comments | « Source/platform/audio/UpSampler.cpp ('k') | Source/platform/graphics/filters/FEGaussianBlur.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698