Changeset View
Changeset View
Standalone View
Standalone View
effects/showpaint/showpaint.cpp
Context not available. | |||||
86 | vbo->setColor(color); | 86 | vbo->setColor(color); | ||
---|---|---|---|---|---|
87 | QVector<float> verts; | 87 | QVector<float> verts; | ||
88 | verts.reserve(painted.rects().count() * 12); | 88 | verts.reserve(painted.rects().count() * 12); | ||
89 | foreach (const QRect & r, painted.rects()) { | 89 | const QVector<QRect> paintedRects = painted.rects(); | ||
90 | for (const QRect & r : paintedRects) { | ||||
90 | verts << r.x() + r.width() << r.y(); | 91 | verts << r.x() + r.width() << r.y(); | ||
91 | verts << r.x() << r.y(); | 92 | verts << r.x() << r.y(); | ||
92 | verts << r.x() << r.y() + r.height(); | 93 | verts << r.x() << r.y() + r.height(); | ||
Context not available. | |||||
110 | col.green = int(alpha * 0xffff * color.green() / 255); | 111 | col.green = int(alpha * 0xffff * color.green() / 255); | ||
111 | col.blue = int(alpha * 0xffff * color.blue() / 255); | 112 | col.blue = int(alpha * 0xffff * color.blue() / 255); | ||
112 | QVector<xcb_rectangle_t> rects; | 113 | QVector<xcb_rectangle_t> rects; | ||
113 | foreach (const QRect & r, painted.rects()) { | 114 | const QVector<QRect> paintedRects = painted.rects(); | ||
115 | for (const QRect & r : paintedRects) { | ||||
114 | xcb_rectangle_t rect = {int16_t(r.x()), int16_t(r.y()), uint16_t(r.width()), uint16_t(r.height())}; | 116 | xcb_rectangle_t rect = {int16_t(r.x()), int16_t(r.y()), uint16_t(r.width()), uint16_t(r.height())}; | ||
115 | rects << rect; | 117 | rects << rect; | ||
116 | } | 118 | } | ||
Context not available. | |||||
122 | { | 124 | { | ||
123 | QColor color = colors[ color_index ]; | 125 | QColor color = colors[ color_index ]; | ||
124 | color.setAlphaF(0.2); | 126 | color.setAlphaF(0.2); | ||
125 | foreach (const QRect & r, painted.rects()) { | 127 | const QVector<QRect> paintedRects = painted.rects(); | ||
128 | for (const QRect & r : paintedRects) { | ||||
126 | effects->scenePainter()->fillRect(r, color); | 129 | effects->scenePainter()->fillRect(r, color); | ||
127 | } | 130 | } | ||
128 | } | 131 | } | ||
Context not available. |