From 16acf75151ae9d2d367ddbb54f39b86606bc6fb3 Mon Sep 17 00:00:00 2001 From: "humper@google.com" Date: Fri, 19 Jul 2013 21:12:08 +0000 Subject: [PATCH] use SK_ScalarPI, and fix ARM build git-svn-id: http://skia.googlecode.com/svn/trunk@10212 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gyp/opts.gyp | 1 + src/core/SkBitmapFilter.h | 8 ++------ src/opts/SkBitmapProcState_opts_arm.cpp | 4 ++++ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gyp/opts.gyp b/gyp/opts.gyp index bcc85a9bae..c15cfb651a 100644 --- a/gyp/opts.gyp +++ b/gyp/opts.gyp @@ -96,6 +96,7 @@ [ '(skia_arch_type == "arm" and armv7 == 0) or (skia_os == "ios")', { 'sources': [ '../src/opts/SkBitmapProcState_opts_none.cpp', + '../src/opts/SkBitmapFilter_opts_none.cpp', '../src/opts/SkBlitRow_opts_none.cpp', '../src/opts/SkUtils_opts_none.cpp', ], 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 - // 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(M_PI); + const float xpi = x * static_cast(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(M_PI); + float xpi = x * static_cast(SK_ScalarPI); return (sk_float_sin(xpi) / xpi) * // sinc(x) sk_float_sin(xpi / fWidth) / (xpi / fWidth); // sinc(x/fWidth) } diff --git a/src/opts/SkBitmapProcState_opts_arm.cpp b/src/opts/SkBitmapProcState_opts_arm.cpp index 99da0da24a..46c700f098 100644 --- a/src/opts/SkBitmapProcState_opts_arm.cpp +++ b/src/opts/SkBitmapProcState_opts_arm.cpp @@ -217,3 +217,7 @@ void SkBitmapProcState::platformProcs() { break; } } + +void SkBitmapProcState::platformConvolutionProcs() { + // no specialization for ARM here yet. +} \ No newline at end of file