Changeset View
Changeset View
Standalone View
Standalone View
scene.cpp
Context not available. | |||||
100 | 100 | | |||
---|---|---|---|---|---|
101 | Scene::~Scene() | 101 | Scene::~Scene() | ||
102 | { | 102 | { | ||
103 | foreach (Window *w, m_windows) { | 103 | for (Window *w : qAsConst(m_windows)) { | ||
104 | delete w; | 104 | delete w; | ||
105 | } | 105 | } | ||
106 | } | 106 | } | ||
Context not available. | |||||
150 | ScreenPaintData data(projection, outputGeometry); | 150 | ScreenPaintData data(projection, outputGeometry); | ||
151 | effects->paintScreen(*mask, region, data); | 151 | effects->paintScreen(*mask, region, data); | ||
152 | 152 | | |||
153 | foreach (Window *w, stacking_order) { | 153 | for (Window *w : qAsConst(stacking_order)) { | ||
154 | effects->postPaintWindow(effectWindow(w)); | 154 | effects->postPaintWindow(effectWindow(w)); | ||
155 | } | 155 | } | ||
156 | 156 | | |||
Context not available. | |||||
209 | paintBackground(infiniteRegion()); | 209 | paintBackground(infiniteRegion()); | ||
210 | } | 210 | } | ||
211 | QList< Phase2Data > phase2; | 211 | QList< Phase2Data > phase2; | ||
212 | foreach (Window * w, stacking_order) { // bottom to top | 212 | for (Window * w : qAsConst(stacking_order)) { // bottom to top | ||
213 | Toplevel* topw = w->window(); | 213 | Toplevel* topw = w->window(); | ||
214 | 214 | | |||
215 | // Reset the repaint_region. | 215 | // Reset the repaint_region. | ||
Context not available. | |||||
236 | phase2.append(Phase2Data(w, infiniteRegion(), data.clip, data.mask, data.quads)); | 236 | phase2.append(Phase2Data(w, infiniteRegion(), data.clip, data.mask, data.quads)); | ||
237 | } | 237 | } | ||
238 | 238 | | |||
239 | foreach (const Phase2Data & d, phase2) { | 239 | for (const Phase2Data & d : qAsConst(phase2)) { | ||
240 | paintWindow(d.window, d.mask, d.region, d.quads); | 240 | paintWindow(d.window, d.mask, d.region, d.quads); | ||
241 | } | 241 | } | ||
242 | 242 | | |||
Context not available. | |||||
439 | void Scene::createStackingOrder(ToplevelList toplevels) | 439 | void Scene::createStackingOrder(ToplevelList toplevels) | ||
440 | { | 440 | { | ||
441 | // TODO: cache the stacking_order in case it has not changed | 441 | // TODO: cache the stacking_order in case it has not changed | ||
442 | foreach (Toplevel *c, toplevels) { | 442 | for (Toplevel *c : qAsConst(toplevels)) { | ||
443 | assert(m_windows.contains(c)); | 443 | assert(m_windows.contains(c)); | ||
444 | stacking_order.append(m_windows[ c ]); | 444 | stacking_order.append(m_windows[ c ]); | ||
445 | } | 445 | } | ||
Context not available. | |||||
873 | }; | 873 | }; | ||
874 | 874 | | |||
875 | for (int i = 0; i < 4; i++) { | 875 | for (int i = 0; i < 4; i++) { | ||
876 | foreach (const QRect &r, (region & rects[i]).rects()) { | 876 | const QVector<QRect> regionAndRects = (region & rects[i]).rects(); | ||
877 | for (const QRect &r : regionAndRects) { | ||||
877 | if (!r.isValid()) | 878 | if (!r.isValid()) | ||
878 | continue; | 879 | continue; | ||
879 | 880 | | |||
Context not available. | |||||
914 | WindowQuadList Scene::Window::makeQuads(WindowQuadType type, const QRegion& reg, const QPoint &textureOffset, qreal scale) const | 915 | WindowQuadList Scene::Window::makeQuads(WindowQuadType type, const QRegion& reg, const QPoint &textureOffset, qreal scale) const | ||
915 | { | 916 | { | ||
916 | WindowQuadList ret; | 917 | WindowQuadList ret; | ||
917 | foreach (const QRect & r, reg.rects()) { | 918 | const QVector<QRect> rects = reg.rects(); | ||
919 | for (const QRect & r : rects) { | ||||
918 | WindowQuad quad(type); | 920 | WindowQuad quad(type); | ||
919 | // TODO asi mam spatne pravy dolni roh - bud tady, nebo v jinych castech | 921 | // TODO asi mam spatne pravy dolni roh - bud tady, nebo v jinych castech | ||
920 | quad[ 0 ] = WindowVertex(QPointF(r.x(), r.y()), | 922 | quad[ 0 ] = WindowVertex(QPointF(r.x(), r.y()), | ||
Context not available. |