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

Unified Diff: src/pdf/SkPDFUtils.h

Issue 1720863003: SkPDF: fix scalar serialization (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-02-24 (Wednesday) 16:44:08 EST Created 4 years, 10 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 | « gm/skbug_4868.cpp ('k') | src/pdf/SkPDFUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « gm/skbug_4868.cpp ('k') | src/pdf/SkPDFUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698