use SK_ScalarPI, and fix ARM build
git-svn-id: http://skia.googlecode.com/svn/trunk@10212 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
dd85088cd3
commit
16acf75151
@ -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',
|
||||
],
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -217,3 +217,7 @@ void SkBitmapProcState::platformProcs() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SkBitmapProcState::platformConvolutionProcs() {
|
||||
// no specialization for ARM here yet.
|
||||
}
|
Loading…
Reference in New Issue
Block a user