summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp7
-rw-r--r--third_party/skia_shared/SkFloatToDecimal.cpp4
-rw-r--r--third_party/skia_shared/SkFloatToDecimal.h6
3 files changed, 14 insertions, 3 deletions
diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
index a2d4d4f125..0584e7be48 100644
--- a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
+++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
@@ -223,10 +223,11 @@ void CPDF_PageContentGenerator::ProcessPath(std::ostringstream* buf,
if (i > 0)
*buf << " ";
- char buffer[kMaximumSkFloatToDecimalLength];
- unsigned size = SkFloatToDecimal(pPoints[i].m_Point.x, buffer);
+ char buffer[pdfium::skia::kMaximumSkFloatToDecimalLength];
+ unsigned size =
+ pdfium::skia::SkFloatToDecimal(pPoints[i].m_Point.x, buffer);
buf->write(buffer, size) << " ";
- size = SkFloatToDecimal(pPoints[i].m_Point.y, buffer);
+ size = pdfium::skia::SkFloatToDecimal(pPoints[i].m_Point.y, buffer);
buf->write(buffer, size);
FXPT_TYPE pointType = pPoints[i].m_Type;
diff --git a/third_party/skia_shared/SkFloatToDecimal.cpp b/third_party/skia_shared/SkFloatToDecimal.cpp
index ac24a11e91..1f99990b8f 100644
--- a/third_party/skia_shared/SkFloatToDecimal.cpp
+++ b/third_party/skia_shared/SkFloatToDecimal.cpp
@@ -48,6 +48,8 @@ static double pow10(int e) {
}
}
+namespace pdfium {
+namespace skia {
/** Write a string into result, includeing a terminating '\0' (for
unit testing). Return strlen(result) (for SkWStream::write) The
resulting string will be in the form /[-]?([0-9]*.)?[0-9]+/ and
@@ -172,3 +174,5 @@ unsigned SkFloatToDecimal(float value, char result[kMaximumSkFloatToDecimalLengt
*output = '\0';
return static_cast<unsigned>(output - result);
}
+} // namespace skia
+} // namespace pdfium
diff --git a/third_party/skia_shared/SkFloatToDecimal.h b/third_party/skia_shared/SkFloatToDecimal.h
index ac1042dbfb..376b093b25 100644
--- a/third_party/skia_shared/SkFloatToDecimal.h
+++ b/third_party/skia_shared/SkFloatToDecimal.h
@@ -8,6 +8,9 @@
#ifndef SkFloatToDecimal_DEFINED
#define SkFloatToDecimal_DEFINED
+namespace pdfium {
+namespace skia {
+
constexpr unsigned kMaximumSkFloatToDecimalLength = 49;
/** \fn SkFloatToDecimal
@@ -31,4 +34,7 @@ constexpr unsigned kMaximumSkFloatToDecimalLength = 49;
*/
unsigned SkFloatToDecimal(float value, char output[kMaximumSkFloatToDecimalLength]);
+} // namespace skia
+} // namespace pdfium
+
#endif // SkFloatToDecimal_DEFINED