Index: src/pdf/SkPDFUtils.h |
diff --git a/src/pdf/SkPDFUtils.h b/src/pdf/SkPDFUtils.h |
index 0aa05a088a8e59898a9d4d1e776d9ede37fd322f..814d77193cb38d5bd803f847cf36a5e6ab2d1603 100644 |
--- a/src/pdf/SkPDFUtils.h |
+++ b/src/pdf/SkPDFUtils.h |
@@ -58,6 +58,14 @@ public: |
static void DrawFormXObject(int objectIndex, SkWStream* content); |
static void ApplyGraphicState(int objectIndex, SkWStream* content); |
static void ApplyPattern(int objectIndex, SkWStream* content); |
+ |
+ // 3 = '-', '.', and '\0' characters. |
+ // 9 = number of significant digits |
+ // abs(FLT_MIN_10_EXP) = number of zeros in FLT_MIN |
+ static const size_t kMaximumFloatDecimalLength = 3 + 9 - FLT_MIN_10_EXP; |
+ // FloatToDecimal is exposed for unit tests. |
+ static size_t FloatToDecimal(float value, |
+ char output[kMaximumFloatDecimalLength]); |
static void AppendScalar(SkScalar value, SkWStream* stream); |
static SkString FormatString(const char* input, size_t len); |
}; |