Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/scene_qpainter_test.cpp
Show First 20 Lines • Show All 220 Lines • ▼ Show 20 Line(s) | 203 | { | |||
---|---|---|---|---|---|
221 | Test::render(cs.data(), QSize(10, 10), Qt::red); | 221 | Test::render(cs.data(), QSize(10, 10), Qt::red); | ||
222 | p->setCursor(cs.data(), QPoint(5, 5)); | 222 | p->setCursor(cs.data(), QPoint(5, 5)); | ||
223 | 223 | | |||
224 | // now let's map the window | 224 | // now let's map the window | ||
225 | s->setScale(2); | 225 | s->setScale(2); | ||
226 | 226 | | |||
227 | //draw a blue square@400x600 with red rectangle@200x200 in the middle | 227 | //draw a blue square@400x600 with red rectangle@200x200 in the middle | ||
228 | const QSize size(400,600); | 228 | const QSize size(400,600); | ||
229 | QImage img(size, QImage::Format_ARGB32); | 229 | QImage img(size, QImage::Format_ARGB32_Premultiplied); | ||
230 | img.fill(Qt::blue); | 230 | img.fill(Qt::blue); | ||
231 | QPainter surfacePainter(&img); | 231 | QPainter surfacePainter(&img); | ||
232 | surfacePainter.fillRect(200,300,200,200, Qt::red); | 232 | surfacePainter.fillRect(200,300,200,200, Qt::red); | ||
233 | 233 | | |||
234 | //add buffer | 234 | //add buffer | ||
235 | Test::render(s.data(), img); | 235 | Test::render(s.data(), img); | ||
236 | Test::waitForWaylandWindowShown(); | 236 | Test::waitForWaylandWindowShown(); | ||
237 | 237 | | |||
▲ Show 20 Lines • Show All 152 Lines • Show Last 20 Lines |