Changeset View
Changeset View
Standalone View
Standalone View
effects/showfps/showfps.cpp
Context not available. | |||||
142 | QRegion r2 = region & QRect(w->x(), w->y(), w->width(), w->height()); | 142 | QRegion r2 = region & QRect(w->x(), w->y(), w->width(), w->height()); | ||
---|---|---|---|---|---|
143 | r2 -= fps_rect; | 143 | r2 -= fps_rect; | ||
144 | int winsize = 0; | 144 | int winsize = 0; | ||
145 | foreach (const QRect & r, r2.rects()) | 145 | QVector<QRect> rects = r2.rects(); | ||
146 | winsize += r.width() * r.height(); | 146 | for (const QRect & r : rects) | ||
147 | winsize += r.width() * r.height(); | ||||
147 | paint_size[ paints_pos ] += winsize; | 148 | paint_size[ paints_pos ] += winsize; | ||
148 | } | 149 | } | ||
149 | 150 | | |||
Context not available. | |||||
398 | vbo->setColor(color); | 399 | vbo->setColor(color); | ||
399 | QVector<float> verts; | 400 | QVector<float> verts; | ||
400 | // First draw the lines | 401 | // First draw the lines | ||
401 | foreach (int h, lines) { | 402 | for (int h : qAsConst(lines)) { | ||
402 | verts << x << y - h; | 403 | verts << x << y - h; | ||
403 | verts << x + values.count() << y - h; | 404 | verts << x + values.count() << y - h; | ||
404 | } | 405 | } | ||
Context not available. | |||||
483 | // Then the lines | 484 | // Then the lines | ||
484 | col.red = col.green = col.blue = 0; // black | 485 | col.red = col.green = col.blue = 0; // black | ||
485 | QVector<xcb_rectangle_t> rects; | 486 | QVector<xcb_rectangle_t> rects; | ||
486 | foreach (int h, lines) { | 487 | for (int h : qAsConst(lines)) { | ||
487 | xcb_rectangle_t rect = {0, int16_t(MAX_TIME - h), uint16_t(values.count()), 1}; | 488 | xcb_rectangle_t rect = {0, int16_t(MAX_TIME - h), uint16_t(values.count()), 1}; | ||
488 | rects << rect; | 489 | rects << rect; | ||
489 | } | 490 | } | ||
Context not available. | |||||
498 | QPainter *painter = effects->scenePainter(); | 499 | QPainter *painter = effects->scenePainter(); | ||
499 | painter->setPen(Qt::black); | 500 | painter->setPen(Qt::black); | ||
500 | // First draw the lines | 501 | // First draw the lines | ||
501 | foreach (int h, lines) { | 502 | for (int h : qAsConst(lines)) { | ||
502 | painter->drawLine(x, y - h, x + values.count(), y - h); | 503 | painter->drawLine(x, y - h, x + values.count(), y - h); | ||
503 | } | 504 | } | ||
504 | QColor color(0, 0, 0); | 505 | QColor color(0, 0, 0); | ||
Context not available. |