Changeset View
Changeset View
Standalone View
Standalone View
effects/showfps/showfps.h
Show All 15 Lines | |||||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | 20 | | |||
21 | #ifndef KWIN_SHOWFPS_H | 21 | #ifndef KWIN_SHOWFPS_H | ||
22 | #define KWIN_SHOWFPS_H | 22 | #define KWIN_SHOWFPS_H | ||
23 | 23 | | |||
24 | #include <QTime> | 24 | #include <QElapsedTimer> | ||
25 | #include <QFont> | 25 | #include <QFont> | ||
26 | 26 | | |||
27 | #include <kwineffects.h> | 27 | #include <kwineffects.h> | ||
28 | 28 | | |||
29 | 29 | | |||
30 | namespace KWin | 30 | namespace KWin | ||
31 | { | 31 | { | ||
32 | class GLTexture; | 32 | class GLTexture; | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
78 | #ifdef KWIN_HAVE_XRENDER_COMPOSITING | 78 | #ifdef KWIN_HAVE_XRENDER_COMPOSITING | ||
79 | void paintXrender(int fps); | 79 | void paintXrender(int fps); | ||
80 | #endif | 80 | #endif | ||
81 | void paintQPainter(int fps); | 81 | void paintQPainter(int fps); | ||
82 | void paintFPSGraph(int x, int y); | 82 | void paintFPSGraph(int x, int y); | ||
83 | void paintDrawSizeGraph(int x, int y); | 83 | void paintDrawSizeGraph(int x, int y); | ||
84 | void paintGraph(int x, int y, QList<int> values, QList<int> lines, bool colorize); | 84 | void paintGraph(int x, int y, QList<int> values, QList<int> lines, bool colorize); | ||
85 | QImage fpsTextImage(int fps); | 85 | QImage fpsTextImage(int fps); | ||
86 | QTime t; | 86 | QElapsedTimer t; | ||
87 | enum { NUM_PAINTS = 100 }; // remember time needed to paint this many paints | 87 | enum { NUM_PAINTS = 100 }; // remember time needed to paint this many paints | ||
88 | int paints[ NUM_PAINTS ]; // time needed to paint | 88 | int paints[ NUM_PAINTS ]; // time needed to paint | ||
89 | int paint_size[ NUM_PAINTS ]; // number of pixels painted | 89 | int paint_size[ NUM_PAINTS ]; // number of pixels painted | ||
90 | int paints_pos; // position in the queue | 90 | int paints_pos; // position in the queue | ||
91 | enum { MAX_FPS = 200 }; | 91 | enum { MAX_FPS = 200 }; | ||
92 | int frames[ MAX_FPS ]; // (sec*1000+msec) of the time the frame was done | 92 | int frames[ MAX_FPS ]; // (sec*1000+msec) of the time the frame was done | ||
93 | int frames_pos; // position in the queue | 93 | int frames_pos; // position in the queue | ||
94 | double alpha; | 94 | double alpha; | ||
Show All 15 Lines |