diff options
Diffstat (limited to 'src/core/SkString.cpp')
-rw-r--r-- | src/core/SkString.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/core/SkString.cpp b/src/core/SkString.cpp index 2e2c0e7173..24b1b8fb62 100644 --- a/src/core/SkString.cpp +++ b/src/core/SkString.cpp @@ -7,7 +7,6 @@ #include "SkAtomics.h" -#include "SkFixed.h" #include "SkString.h" #include "SkUtils.h" #include <stdarg.h> @@ -143,44 +142,6 @@ char* SkStrAppendFloat(char string[], float value) { return string + len; } -char* SkStrAppendFixed(char string[], SkFixed x) { - SkDEBUGCODE(char* start = string;) - if (x < 0) { - *string++ = '-'; - x = -x; - } - - unsigned frac = x & 0xFFFF; - x >>= 16; - if (frac == 0xFFFF) { - // need to do this to "round up", since 65535/65536 is closer to 1 than to .9999 - x += 1; - frac = 0; - } - string = SkStrAppendS32(string, x); - - // now handle the fractional part (if any) - if (frac) { - static const uint16_t gTens[] = { 1000, 100, 10, 1 }; - const uint16_t* tens = gTens; - - x = SkFixedRoundToInt(frac * 10000); - SkASSERT(x <= 10000); - if (x == 10000) { - x -= 1; - } - *string++ = '.'; - do { - unsigned powerOfTen = *tens++; - *string++ = SkToU8('0' + x / powerOfTen); - x %= powerOfTen; - } while (x != 0); - } - - SkASSERT(string - start <= SkStrAppendScalar_MaxSize); - return string; -} - /////////////////////////////////////////////////////////////////////////////// // the 3 values are [length] [refcnt] [terminating zero data] |