use SK_ScalarPI, and fix ARM build
authorhumper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 19 Jul 2013 21:12:08 +0000 (21:12 +0000)
committerhumper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 19 Jul 2013 21:12:08 +0000 (21:12 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@10212 2bbb7eff-a529-9590-31e7-b0007b416f81

gyp/opts.gyp
src/core/SkBitmapFilter.h
src/opts/SkBitmapProcState_opts_arm.cpp

index bcc85a9bae69d9402f88f9e58ab6a85eecd97e78..c15cfb651ae9b8295b12fd58c73087e6579a684f 100644 (file)
@@ -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',
           ],
index dc4de153354f567cf2c109fccd1c60912ef14194..1fcbfc86d04869153f6f6ba338b67869335047e0 100644 (file)
 
 #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)
       }      
index 99da0da24ab165843778513be203d641fd7bb0f7..46c700f0981c845369e32bdc3cc26420bf6ad050 100644 (file)
@@ -217,3 +217,7 @@ void SkBitmapProcState::platformProcs() {
             break;
     }
 }
+
+void SkBitmapProcState::platformConvolutionProcs() {
+    // no specialization for ARM here yet.
+}
\ No newline at end of file