aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapFilter.h
diff options
context:
space:
mode:
authorGravatar humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-19 21:12:08 +0000
committerGravatar humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-19 21:12:08 +0000
commit16acf75151ae9d2d367ddbb54f39b86606bc6fb3 (patch)
tree46f209edc91c5b47808233bbdb324de5b3a0c22b /src/core/SkBitmapFilter.h
parentdd85088cd3c9b9890318a16f1fadb16e6d0253d0 (diff)
use SK_ScalarPI, and fix ARM build
git-svn-id: http://skia.googlecode.com/svn/trunk@10212 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkBitmapFilter.h')
-rw-r--r--src/core/SkBitmapFilter.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/SkBitmapFilter.h b/src/core/SkBitmapFilter.h
index dc4de15335..1fcbfc86d0 100644
--- a/src/core/SkBitmapFilter.h
+++ b/src/core/SkBitmapFilter.h
@@ -12,10 +12,6 @@
#include "SkMath.h"
-
-#define _USE_MATH_DEFINES
-#include <math.h>
-
// size of the precomputed bitmap filter tables for high quality filtering.
// Used to precompute the shape of the filter kernel.
// Table size chosen from experiments to see where I could start to see a difference.
@@ -149,7 +145,7 @@ public:
if (x > -FLT_EPSILON && x < FLT_EPSILON) {
return 1.0f; // Special case the sinc discontinuity at the origin.
}
- const float xpi = x * static_cast<float>(M_PI);
+ const float xpi = x * static_cast<float>(SK_ScalarPI);
return ((sk_float_sin(xpi) / xpi) * // sinc(x)
(0.54f + 0.46f * sk_float_cos(xpi / fWidth))); // hamming(x)
@@ -169,7 +165,7 @@ class SkLanczosFilter: public SkBitmapFilter {
if (x > -FLT_EPSILON && x < FLT_EPSILON) {
return 1.0f; // Special case the discontinuity at the origin.
}
- float xpi = x * static_cast<float>(M_PI);
+ float xpi = x * static_cast<float>(SK_ScalarPI);
return (sk_float_sin(xpi) / xpi) * // sinc(x)
sk_float_sin(xpi / fWidth) / (xpi / fWidth); // sinc(x/fWidth)
}