Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1383)

Unified Diff: src/core/SkString.cpp

Issue 1841123002: Reverse dependency between SkScalar.h and SkFixed.h (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkScan.h ('k') | src/core/SkValidatingReadBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkString.cpp
diff --git a/src/core/SkString.cpp b/src/core/SkString.cpp
index 2e2c0e7173bf439ad159f75a0592523049268d96..24b1b8fb6229f01d251529348c17956a29ccf1e7 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]
« no previous file with comments | « src/core/SkScan.h ('k') | src/core/SkValidatingReadBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698