]> git.cworth.org Git - apitrace/blobdiff - gui/retracer.cpp
gui: remove a depth check box that sneak into alpha code
[apitrace] / gui / retracer.cpp
index 84f974244943b45a551fd561a1f01ce8d8e108ac..69dca6c6b26f542845b5857952177692210f19e7 100644 (file)
@@ -229,11 +229,28 @@ void Retracer::run()
     QString prog;
     QStringList arguments;
 
-    if (m_api == trace::API_GL) {
+    switch (m_api) {
+    case trace::API_GL:
         prog = QLatin1String("glretrace");
-    } else if (m_api == trace::API_EGL) {
+        break;
+    case trace::API_EGL:
         prog = QLatin1String("eglretrace");
-    } else {
+        break;
+    case trace::API_DX:
+    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:
+#ifdef Q_OS_WIN
+        prog = QLatin1String("d3dretrace");
+#else
+        prog = QLatin1String("wine");
+        arguments << QLatin1String("d3dretrace.exe");
+#endif
+        break;
+    default:
         emit finished(QLatin1String("Unsupported API"));
         return;
     }
@@ -283,8 +300,6 @@ void Retracer::run()
             /*
              * Parse JSON from the output.
              *
-             * XXX: QJSON expects blocking IO.
-             *
              * XXX: QJSON's scanner is inneficient as it abuses single
              * character QIODevice::peek (not cheap), instead of maintaining a
              * lookahead character on its own.
@@ -292,7 +307,16 @@ void Retracer::run()
 
             bool ok = false;
             QJson::Parser jsonParser;
+#if 0
             parsedJson = jsonParser.parse(&io, &ok).toMap();
+#else
+            /*
+             * XXX: QJSON expects blocking IO, and it looks like
+             * BlockingIODevice does not work reliably in all cases.
+             */
+            process.waitForFinished(-1);
+            parsedJson = jsonParser.parse(&process, &ok).toMap();
+#endif
             if (!ok) {
                 msg = QLatin1String("failed to parse JSON");
             }