aboutsummaryrefslogtreecommitdiffhomepage
path: root/debugger
diff options
context:
space:
mode:
authorGravatar kkinnunen <kkinnunen@nvidia.com>2014-11-13 05:13:50 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-13 05:13:50 -0800
commit6438f9aca75ae5a92044458fdc20040544e02709 (patch)
tree67e2a24953d5819f2e27f325cb30d8bed79983f7 /debugger
parentc092d3bdab5f723576cc0346cea3ee282a9cb444 (diff)
Fix debugger with GL to work with non-default locale
QApplication forces the process to use the C locale system on "Unix/Linux" according to the docs. The float numbers in GL shaders will be printed with printf. These will be formatted with comma in certain locales, like LC_NUMERIC=fi_FI.UTF-8. Force the NC_NUMERIC=C before running the QApplication. Review URL: https://codereview.chromium.org/724753002
Diffstat (limited to 'debugger')
-rw-r--r--debugger/debuggermain.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/debugger/debuggermain.cpp b/debugger/debuggermain.cpp
index f749911a98..d537d363c9 100644
--- a/debugger/debuggermain.cpp
+++ b/debugger/debuggermain.cpp
@@ -17,8 +17,13 @@ static void usage(const char * argv0) {
}
int main(int argc, char *argv[]) {
+#ifndef SK_BUILD_FOR_WIN32
+ // Set numeric formatting to default. Otherwise shaders will have numbers with wrong comma.
+ // QApplication documentation recommends setlocale("LC_NUMERIC", "C") after QApplication
+ // constuction. However, the components Qt calls (X11 libs, ..) will override that.
+ setenv("LC_NUMERIC", "C", 1);
+#endif
QApplication a(argc, argv);
-
QStringList argList = a.arguments();
if (argList.count() <= 0) {