MythTV  master
mythopenglperf.h
Go to the documentation of this file.
1 #ifndef MYTHOPENGLPERF_H
2 #define MYTHOPENGLPERF_H
3 
4 // Qt
5 #include <QVector>
6 #include <QOpenGLTimeMonitor>
7 
8 // QOpenGLTimeMonitor is not available with Qt GLES2 builds
9 #if defined(QT_OPENGL_ES_2)
10 
11 #ifndef GLuint64
12 using GLuint64 = uint64_t;
13 #endif
14 
15 class QOpenGLTimeMonitor
16 {
17  public:
18  QOpenGLTimeMonitor() {};
19  void setSampleCount(int) {};
20  int sampleCount() const { return 0; };
21  bool create() { return false; };
22  bool isCreated() const { return false; };
23  int recordSample() { return 0; };
24  bool isResultAvailable() const { return false; };
25  QVector<GLuint64> waitForIntervals() const { return QVector<GLuint64>(); };
26  void reset() {};
27 };
28 #endif
29 
30 // MythTV
31 #include "mythuiexp.h"
32 
33 class MUI_PUBLIC MythOpenGLPerf : public QOpenGLTimeMonitor
34 {
35  public:
36  MythOpenGLPerf(QString Name, QVector<QString> Names, int SampleCount = 30);
37  void RecordSample (void);
38  void LogSamples (void);
39  int GetTimersRunning(void);
40 
41  private:
42  QString m_name { };
43  int m_sampleCount { 0 };
44  int m_totalSamples { 30 };
45  bool m_timersReady { true };
46  int m_timersRunning { 0 };
47  QVector<GLuint64> m_timerData { 0 };
48  QVector<QString> m_timerNames { };
49 };
50 
51 #endif // MYTHOPENGLPERF_H
const char * m_name
Definition: ParseText.cpp:328
#define MUI_PUBLIC
Definition: mythuiexp.h:9
A simple overload of QOpenGLTimeMonitor to record and log OpenGL execution intervals.