Changeset View
Changeset View
Standalone View
Standalone View
scene_qpainter.cpp
Show First 20 Lines • Show All 302 Lines • ▼ Show 20 Line(s) | 298 | if (!opaque) { | |||
---|---|---|---|---|---|
303 | tempPainter.save(); | 303 | tempPainter.save(); | ||
304 | tempPainter.translate(toplevel->geometry().topLeft() - toplevel->visibleRect().topLeft()); | 304 | tempPainter.translate(toplevel->geometry().topLeft() - toplevel->visibleRect().topLeft()); | ||
305 | painter = &tempPainter; | 305 | painter = &tempPainter; | ||
306 | } | 306 | } | ||
307 | renderShadow(painter); | 307 | renderShadow(painter); | ||
308 | renderWindowDecorations(painter); | 308 | renderWindowDecorations(painter); | ||
309 | 309 | | |||
310 | // render content | 310 | // render content | ||
311 | const QRect src = QRect(toplevel->clientPos() + toplevel->clientContentPos(), toplevel->clientSize()); | 311 | const QRect target = QRect(toplevel->clientPos(), toplevel->clientSize()); | ||
312 | painter->drawImage(toplevel->clientPos(), pixmap->image(), src); | 312 | const QRect src = QRect(toplevel->clientPos() + toplevel->clientContentPos(), pixmap->image().size()); | ||
313 | painter->drawImage(target, pixmap->image(), src); | ||||
graesslin: do you have a test case in another patch for this? If not I suggest to extend the scene… | |||||
I put a test with the QPainter commit which implicitly will also test this change. davidedmundson: I put a test with the QPainter commit which implicitly will also test this change. | |||||
313 | 314 | | |||
314 | // render subsurfaces | 315 | // render subsurfaces | ||
315 | const auto &children = pixmap->children(); | 316 | const auto &children = pixmap->children(); | ||
316 | for (auto pixmap : children) { | 317 | for (auto pixmap : children) { | ||
317 | if (pixmap->subSurface().isNull() || pixmap->subSurface()->surface().isNull() || !pixmap->subSurface()->surface()->isMapped()) { | 318 | if (pixmap->subSurface().isNull() || pixmap->subSurface()->surface().isNull() || !pixmap->subSurface()->surface()->isMapped()) { | ||
318 | continue; | 319 | continue; | ||
319 | } | 320 | } | ||
320 | paintSubSurface(painter, toplevel->clientPos(), static_cast<QPainterWindowPixmap*>(pixmap)); | 321 | paintSubSurface(painter, toplevel->clientPos(), static_cast<QPainterWindowPixmap*>(pixmap)); | ||
▲ Show 20 Lines • Show All 359 Lines • Show Last 20 Lines |
do you have a test case in another patch for this? If not I suggest to extend the scene qpainter test to verify the rendering is correct with different scaling