]> git.cworth.org Git - apitrace/blob - gui/retracer.h
qapitrace: Add option to replay in singlethreaded mode
[apitrace] / gui / retracer.h
1 #ifndef RETRACER_H
2 #define RETRACER_H
3
4 #include "trace_api.hpp"
5 #include "apitracecall.h"
6
7 #include <QThread>
8 #include <QProcess>
9
10 class ApiTraceState;
11
12 namespace trace { struct Profile; }
13
14 class Retracer : public QThread
15 {
16     Q_OBJECT
17 public:
18     Retracer(QObject *parent=0);
19
20     QString fileName() const;
21     void setFileName(const QString &name);
22
23     QString remoteTarget() const;
24     void setRemoteTarget(const QString &host);
25
26     void setAPI(trace::API api);
27
28     bool isBenchmarking() const;
29     void setBenchmarking(bool bench);
30
31     bool isDoubleBuffered() const;
32     void setDoubleBuffered(bool db);
33
34     bool isSinglethread() const;
35     void setSinglethread(bool singlethread);
36
37     bool isProfilingGpu() const;
38     bool isProfilingCpu() const;
39     bool isProfilingPixels() const;
40     bool isProfiling() const;
41     void setProfiling(bool gpu, bool cpu, bool pixels);
42
43     void setCaptureAtCallNumber(qlonglong num);
44     qlonglong captureAtCallNumber() const;
45
46     bool captureState() const;
47     void setCaptureState(bool enable);
48
49     bool captureThumbnails() const;
50     void setCaptureThumbnails(bool enable);
51
52 signals:
53     void finished(const QString &output);
54     void foundState(ApiTraceState *state);
55     void foundProfile(trace::Profile *profile);
56     void foundThumbnails(const QList<QImage> &thumbnails);
57     void error(const QString &msg);
58     void retraceErrors(const QList<ApiTraceError> &errors);
59
60 protected:
61     virtual void run();
62
63 private:
64     QString m_fileName;
65     QString m_remoteTarget;
66     trace::API m_api;
67     bool m_benchmarking;
68     bool m_doubleBuffered;
69     bool m_singlethread;
70     bool m_captureState;
71     bool m_captureThumbnails;
72     qlonglong m_captureCall;
73     bool m_profileGpu;
74     bool m_profileCpu;
75     bool m_profilePixels;
76 };
77
78 #endif