diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-10-21 15:35:29 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-11-27 09:55:09 +0100 |
commit | 8f7c1fabfdb5d88a3d6f9581d654dd0d2e6495e1 (patch) | |
tree | 8e2542625f93a1083dc624c142a65b50b2d73c72 /external/skia | |
parent | 2b861c8d7e7473ced945ddc6677fe45ff154865e (diff) |
fix Skia/vulkan with some locales
Change-Id: Ie2dcd526efba5631a6956023d864be828c6eb634
Diffstat (limited to 'external/skia')
-rw-r--r-- | external/skia/UnpackedTarball_skia.mk | 2 | ||||
-rw-r--r-- | external/skia/fix-shader-locale.patch.1 | 57 |
2 files changed, 58 insertions, 1 deletions
diff --git a/external/skia/UnpackedTarball_skia.mk b/external/skia/UnpackedTarball_skia.mk index 25543084a8ca..e9905f5abfa7 100644 --- a/external/skia/UnpackedTarball_skia.mk +++ b/external/skia/UnpackedTarball_skia.mk @@ -12,7 +12,7 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,skia)) $(eval $(call gb_UnpackedTarball_set_tarball,skia,$(SKIA_TARBALL))) # TODO -skia_patches := lerp.patch fix-pch.patch fix-ddi.patch make-api-visible.patch.1 +skia_patches := lerp.patch fix-pch.patch fix-ddi.patch make-api-visible.patch.1 fix-shader-locale.patch.1 $(eval $(call gb_UnpackedTarball_set_patchlevel,skia,1)) diff --git a/external/skia/fix-shader-locale.patch.1 b/external/skia/fix-shader-locale.patch.1 new file mode 100644 index 000000000000..71a5b0e00c82 --- /dev/null +++ b/external/skia/fix-shader-locale.patch.1 @@ -0,0 +1,57 @@ +https://bugs.chromium.org/p/skia/issues/detail?id=9550 + +diff --git a/src/core/SkString.cpp b/src/core/SkString.cpp +index d42ee6f07e..1e3ebddf95 100644 +--- a/src/core/SkString.cpp ++++ b/src/core/SkString.cpp +@@ -502,11 +502,15 @@ void SkString::appendf(const char format[], ...) { + } + + void SkString::appendVAList(const char format[], va_list args) { ++ char* oldlocale = strdup( setlocale( LC_NUMERIC, nullptr )); ++ setlocale( LC_NUMERIC, "C" ); + char buffer[kBufferSize]; + int length = vsnprintf(buffer, kBufferSize, format, args); + SkASSERT(length >= 0 && length < SkToInt(kBufferSize)); + + this->append(buffer, length); ++ setlocale( LC_NUMERIC, oldlocale ); ++ free( oldlocale ); + } + + void SkString::prependf(const char format[], ...) { +@@ -519,11 +523,15 @@ void SkString::prependf(const char format[], ...) { + } + + void SkString::prependVAList(const char format[], va_list args) { ++ char* oldlocale = strdup( setlocale( LC_NUMERIC, nullptr )); ++ setlocale( LC_NUMERIC, "C" ); + char buffer[kBufferSize]; + int length = vsnprintf(buffer, kBufferSize, format, args); + SkASSERT(length >= 0 && length < SkToInt(kBufferSize)); + + this->prepend(buffer, length); ++ setlocale( LC_NUMERIC, oldlocale ); ++ free( oldlocale ); + } + + +diff --git a/src/sksl/SkSLOutputStream.cpp b/src/sksl/SkSLOutputStream.cpp +index f72637d4cb..6e31e8f302 100644 +--- a/src/sksl/SkSLOutputStream.cpp ++++ b/src/sksl/SkSLOutputStream.cpp +@@ -21,10 +21,14 @@ void OutputStream::printf(const char format[], ...) { + } + + void OutputStream::appendVAList(const char format[], va_list args) { ++ char* oldlocale = strdup( setlocale( LC_NUMERIC, nullptr )); ++ setlocale( LC_NUMERIC, "C" ); + char buffer[kBufferSize]; + int length = vsnprintf(buffer, kBufferSize, format, args); + SkASSERT(length >= 0 && length < (int) kBufferSize); + this->write(buffer, length); ++ setlocale( LC_NUMERIC, oldlocale ); ++ free( oldlocale ); + } + + } |