make these compile w/o SK_CAN_USE_FLOAT

git-svn-id: http://skia.googlecode.com/svn/trunk@70 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@android.com 2009-01-16 16:21:28 +00:00
parent 4cb8bd18d9
commit c990603b78
3 changed files with 10 additions and 2 deletions

View File

@ -5,8 +5,8 @@ CFLAGS = -O2
DEFINES = -DSK_BUILD_FOR_UNIX
HIDE = @
#DEFINES += -DSK_RELEASE
DEFINES += -DSK_DEBUG -DSK_SUPPORT_UNITTEST
DEFINES += -DSK_RELEASE
#DEFINES += -DSK_DEBUG -DSK_SUPPORT_UNITTEST
#DEFINES += -DSK_SCALAR_IS_FIXED
# start with the core (required)

View File

@ -148,6 +148,7 @@ static void test_drawText(SkBitmap::Config config, SkColor color)
#endif
#ifdef SK_CAN_USE_FLOAT
#include "SkFloatBits.h"
static inline float fast_inc(float x) {
@ -268,13 +269,16 @@ static float time_intToFloat() {
return sum;
}
#endif
#endif
void SkGraphics::Init(bool runUnitTests)
{
SkGlobals::Init();
#ifdef SK_CAN_USE_FLOAT
// time_math();
// time_intToFloat();
#endif
#ifdef BUILD_EMBOSS_TABLE
SkEmbossMask_BuildTable();

View File

@ -576,6 +576,7 @@ static int symmetric_fixmul(int a, int b) {
#ifdef SK_SUPPORT_UNITTEST
static void check_length(const SkPoint& p, SkScalar targetLen) {
#ifdef SK_CAN_USE_FLOAT
float x = SkScalarToFloat(p.fX);
float y = SkScalarToFloat(p.fY);
float len = sk_float_sqrt(x*x + y*y);
@ -583,6 +584,7 @@ static void check_length(const SkPoint& p, SkScalar targetLen) {
len /= SkScalarToFloat(targetLen);
SkASSERT(len > 0.999f && len < 1.001f);
#endif
}
#endif
@ -698,6 +700,7 @@ static void unittest_fastfloat() {
#ifdef SK_SUPPORT_UNITTEST
static void test_muldiv255() {
#ifdef SK_CAN_USE_FLOAT
for (int a = 0; a <= 255; a++) {
for (int b = 0; b <= 255; b++) {
int ab = a * b;
@ -716,6 +719,7 @@ static void test_muldiv255() {
SkASSERT(iround <= b);
}
}
#endif
}
#endif