aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkString.cpp
diff options
context:
space:
mode:
authorGravatar benjaminwagner <benjaminwagner@google.com>2016-04-07 08:49:31 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-07 08:49:31 -0700
commit6c71e0a065c2eb32139682bb1ca1cbbeb02ebcb9 (patch)
tree8ca1b92cf353a1393429b034e95da6ebc3b5eb55 /src/core/SkString.cpp
parent6f01104b1d86b861b366b3511c8f2567eca4a9f3 (diff)
Reverse dependency between SkScalar.h and SkFixed.h.
The following are unused in Chromium, Android, Mozilla, and Google3: - SkFixedToScalar - SkScalarToFixed The following are additionally unused in Skia: - SkStrAppendFixed - SkWriteBuffer::writeFixed BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1841123002 Review URL: https://codereview.chromium.org/1841123002
Diffstat (limited to 'src/core/SkString.cpp')
-rw-r--r--src/core/SkString.cpp39
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]