| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "SkDebuggerGUI.h" | 9 #include "SkDebuggerGUI.h" |
| 10 #include <QApplication> | 10 #include <QApplication> |
| 11 | 11 |
| 12 static void usage(const char * argv0) { | 12 static void usage(const char * argv0) { |
| 13 SkDebugf("%s <input> \n", argv0); | 13 SkDebugf("%s <input> \n", argv0); |
| 14 SkDebugf(" [--help|-h]: show this help message\n"); | 14 SkDebugf(" [--help|-h]: show this help message\n"); |
| 15 SkDebugf("\n\n"); | 15 SkDebugf("\n\n"); |
| 16 SkDebugf(" input: Either a directory or a single .skp file.\n"); | 16 SkDebugf(" input: Either a directory or a single .skp file.\n"); |
| 17 } | 17 } |
| 18 | 18 |
| 19 int main(int argc, char *argv[]) { | 19 int main(int argc, char *argv[]) { |
| 20 #ifndef SK_BUILD_FOR_WIN32 |
| 21 // Set numeric formatting to default. Otherwise shaders will have numbers wi
th wrong comma. |
| 22 // QApplication documentation recommends setlocale("LC_NUMERIC", "C") after
QApplication |
| 23 // constuction. However, the components Qt calls (X11 libs, ..) will overri
de that. |
| 24 setenv("LC_NUMERIC", "C", 1); |
| 25 #endif |
| 20 QApplication a(argc, argv); | 26 QApplication a(argc, argv); |
| 21 | |
| 22 QStringList argList = a.arguments(); | 27 QStringList argList = a.arguments(); |
| 23 | 28 |
| 24 if (argList.count() <= 0) { | 29 if (argList.count() <= 0) { |
| 25 return -1; // should at least have command name | 30 return -1; // should at least have command name |
| 26 } | 31 } |
| 27 | 32 |
| 28 SkString input; | 33 SkString input; |
| 29 | 34 |
| 30 QStringList::const_iterator iter = argList.begin(); | 35 QStringList::const_iterator iter = argList.begin(); |
| 31 | 36 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 50 if (SkStrEndsWith(input.c_str(), ".skp")) { | 55 if (SkStrEndsWith(input.c_str(), ".skp")) { |
| 51 w.openFile(input.c_str()); | 56 w.openFile(input.c_str()); |
| 52 } else { | 57 } else { |
| 53 w.setupDirectoryWidget(input.c_str()); | 58 w.setupDirectoryWidget(input.c_str()); |
| 54 } | 59 } |
| 55 } | 60 } |
| 56 | 61 |
| 57 w.show(); | 62 w.show(); |
| 58 return a.exec(); | 63 return a.exec(); |
| 59 } | 64 } |
| OLD | NEW |