]> git.cworth.org Git - apitrace/blobdiff - gui/retracer.h
qapitrace: Adjust PATH only once and for all.
[apitrace] / gui / retracer.h
index 1b5a4bd04313ed0ed3406eb42588397583bdc60f..af1a3d9f7b727b70f1173dcc058980bba590f6a6 100644 (file)
@@ -1,70 +1,15 @@
 #ifndef RETRACER_H
 #define RETRACER_H
 
+#include "trace_api.hpp"
+#include "apitracecall.h"
+
 #include <QThread>
 #include <QProcess>
 
 class ApiTraceState;
-namespace QJson {
-    class Parser;
-}
-
-struct RetraceError {
-    int callIndex;
-    QString type;
-    QString message;
-};
-
-/* internal class used by the retracer to run
- * in the thread */
-class RetraceProcess : public QObject
-{
-    Q_OBJECT
-public:
-    RetraceProcess(QObject *parent=0);
-    ~RetraceProcess();
-
-    QProcess *process() const;
-
-    QString fileName() const;
-    void setFileName(const QString &name);
-
-    bool isBenchmarking() const;
-    void setBenchmarking(bool bench);
-
-    bool isDoubleBuffered() const;
-    void setDoubleBuffered(bool db);
-
-    void setCaptureAtCallNumber(qlonglong num);
-    qlonglong captureAtCallNumber() const;
-
-    bool captureState() const;
-    void setCaptureState(bool enable);
-
-public slots:
-    void start();
-    void terminate();
-
-signals:
-    void finished(const QString &output);
-    void error(const QString &msg);
-    void foundState(const ApiTraceState &state);
-    void retraceErrors(const QList<RetraceError> &errors);
-
-private slots:
-    void replayFinished();
-    void replayError(QProcess::ProcessError err);
-
-private:
-    QString m_fileName;
-    bool m_benchmarking;
-    bool m_doubleBuffered;
-    bool m_captureState;
-    qlonglong m_captureCall;
 
-    QProcess *m_process;
-    QJson::Parser *m_jsonParser;
-};
+namespace trace { struct Profile; }
 
 class Retracer : public QThread
 {
@@ -75,37 +20,51 @@ public:
     QString fileName() const;
     void setFileName(const QString &name);
 
+    void setAPI(trace::API api);
+
     bool isBenchmarking() const;
     void setBenchmarking(bool bench);
 
     bool isDoubleBuffered() const;
     void setDoubleBuffered(bool db);
 
+    bool isProfilingGpu() const;
+    bool isProfilingCpu() const;
+    bool isProfilingPixels() const;
+    bool isProfiling() const;
+    void setProfiling(bool gpu, bool cpu, bool pixels);
+
     void setCaptureAtCallNumber(qlonglong num);
     qlonglong captureAtCallNumber() const;
 
     bool captureState() const;
     void setCaptureState(bool enable);
 
+    bool captureThumbnails() const;
+    void setCaptureThumbnails(bool enable);
+
 signals:
     void finished(const QString &output);
-    void foundState(const ApiTraceState &state);
+    void foundState(ApiTraceState *state);
+    void foundProfile(trace::Profile *profile);
+    void foundThumbnails(const QList<QImage> &thumbnails);
     void error(const QString &msg);
-    void retraceErrors(const QList<RetraceError> &errors);
+    void retraceErrors(const QList<ApiTraceError> &errors);
 
 protected:
     virtual void run();
 
-private slots:
-    void cleanup();
 private:
     QString m_fileName;
+    trace::API m_api;
     bool m_benchmarking;
     bool m_doubleBuffered;
     bool m_captureState;
+    bool m_captureThumbnails;
     qlonglong m_captureCall;
-
-    QProcessEnvironment m_processEnvironment;
+    bool m_profileGpu;
+    bool m_profileCpu;
+    bool m_profilePixels;
 };
 
 #endif