Changeset View
Changeset View
Standalone View
Standalone View
effects/showfps/showfps.cpp
Show First 20 Lines • Show All 145 Lines • ▼ Show 20 Line(s) | 140 | { | |||
---|---|---|---|---|---|
146 | r2 -= fps_rect; | 146 | r2 -= fps_rect; | ||
147 | int winsize = 0; | 147 | int winsize = 0; | ||
148 | for (const QRect &r : r2) { | 148 | for (const QRect &r : r2) { | ||
149 | winsize += r.width() * r.height(); | 149 | winsize += r.width() * r.height(); | ||
150 | } | 150 | } | ||
151 | paint_size[ paints_pos ] += winsize; | 151 | paint_size[ paints_pos ] += winsize; | ||
152 | } | 152 | } | ||
153 | 153 | | |||
154 | void ShowFpsEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) | 154 | void ShowFpsEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) | ||
155 | { | 155 | { | ||
156 | effects->paintScreen(mask, region, data); | 156 | effects->paintScreen(mask, region, data); | ||
157 | int fps = 0; | 157 | int fps = 0; | ||
158 | for (int i = 0; | 158 | for (int i = 0; | ||
159 | i < MAX_FPS; | 159 | i < MAX_FPS; | ||
160 | ++i) | 160 | ++i) | ||
161 | if (abs(t.minute() * 60000 + t.second() * 1000 + t.msec() - frames[ i ]) < 1000) | 161 | if (abs(t.minute() * 60000 + t.second() * 1000 + t.msec() - frames[ i ]) < 1000) | ||
162 | ++fps; // count all frames in the last second | 162 | ++fps; // count all frames in the last second | ||
▲ Show 20 Lines • Show All 388 Lines • Show Last 20 Lines |