]> git.cworth.org Git - apitrace/blobdiff - gui/retracer.cpp
qapitrace: Adjust PATH only once and for all.
[apitrace] / gui / retracer.cpp
index 87d9f37dee89b655fa1c95ce0a0512a515457a38..2928ed63f321f31e34667e2448e1b8f765f2fdbf 100644 (file)
@@ -3,7 +3,7 @@
 #include "apitracecall.h"
 #include "thumbnail.h"
 
-#include "image.hpp"
+#include "image/image.hpp"
 
 #include "trace_profiler.hpp"
 
@@ -137,19 +137,6 @@ Retracer::Retracer(QObject *parent)
       m_profilePixels(false)
 {
     qRegisterMetaType<QList<ApiTraceError> >();
-
-#ifdef Q_OS_WIN
-    QString format = QLatin1String("%1;");
-#else
-    QString format = QLatin1String("%1:");
-#endif
-    QString buildPath = format.arg(APITRACE_BINARY_DIR);
-    m_processEnvironment = QProcessEnvironment::systemEnvironment();
-    m_processEnvironment.insert("PATH", buildPath +
-                                m_processEnvironment.value("PATH"));
-
-    qputenv("PATH",
-            m_processEnvironment.value("PATH").toLatin1());
 }
 
 QString Retracer::fileName() const
@@ -271,9 +258,7 @@ void Retracer::run()
     case trace::API_D3D7:
     case trace::API_D3D8:
     case trace::API_D3D9:
-    case trace::API_D3D10:
-    case trace::API_D3D10_1:
-    case trace::API_D3D11:
+    case trace::API_DXGI:
 #ifdef Q_OS_WIN
         prog = QLatin1String("d3dretrace");
 #else
@@ -294,21 +279,21 @@ void Retracer::run()
         arguments << QLatin1String("-"); // emit to stdout
     } else if (isProfiling()) {
         if (m_profileGpu) {
-            arguments << QLatin1String("-pgpu");
+            arguments << QLatin1String("--pgpu");
         }
 
         if (m_profileCpu) {
-            arguments << QLatin1String("-pcpu");
+            arguments << QLatin1String("--pcpu");
         }
 
         if (m_profilePixels) {
-            arguments << QLatin1String("-ppd");
+            arguments << QLatin1String("--ppd");
         }
     } else {
         if (m_doubleBuffered) {
-            arguments << QLatin1String("-db");
+            arguments << QLatin1String("--db");
         } else {
-            arguments << QLatin1String("-sb");
+            arguments << QLatin1String("--sb");
         }
 
         if (m_benchmarking) {
@@ -353,6 +338,9 @@ void Retracer::run()
 
             bool ok = false;
             QJson::Parser jsonParser;
+
+            // Allow Nan/Infinity
+            jsonParser.allowSpecialNumbers(true);
 #if 0
             parsedJson = jsonParser.parse(&io, &ok).toMap();
 #else
@@ -408,6 +396,7 @@ void Retracer::run()
                     unsigned char *scanLine = snapshot.scanLine(y);
                     qint64 readBytes = io.read((char *) scanLine, rowBytes);
                     Q_ASSERT(readBytes == rowBytes);
+                    (void)readBytes;
                 }
 
                 QImage thumb = thumbnail(snapshot);
@@ -417,7 +406,6 @@ void Retracer::run()
             Q_ASSERT(process.state() != QProcess::Running);
         } else if (isProfiling()) {
             profile = new trace::Profile();
-            process.waitForFinished(-1);
 
             while (!io.atEnd()) {
                 char line[256];