Changeset View
Changeset View
Standalone View
Standalone View
plugins/scenes/qpainter/scene_qpainter.cpp
Show First 20 Lines • Show All 268 Lines • ▼ Show 20 Line(s) | 265 | if (!opaque) { | |||
---|---|---|---|---|---|
269 | tempPainter.begin(&tempImage); | 269 | tempPainter.begin(&tempImage); | ||
270 | tempPainter.save(); | 270 | tempPainter.save(); | ||
271 | tempPainter.translate(toplevel->geometry().topLeft() - toplevel->visibleRect().topLeft()); | 271 | tempPainter.translate(toplevel->geometry().topLeft() - toplevel->visibleRect().topLeft()); | ||
272 | painter = &tempPainter; | 272 | painter = &tempPainter; | ||
273 | } | 273 | } | ||
274 | renderShadow(painter); | 274 | renderShadow(painter); | ||
275 | renderWindowDecorations(painter); | 275 | renderWindowDecorations(painter); | ||
276 | 276 | | |||
277 | | ||||
277 | // render content | 278 | // render content | ||
278 | const QRect target = QRect(toplevel->clientPos(), toplevel->clientSize()); | 279 | const QRect target = QRect(toplevel->clientPos(), toplevel->clientSize()); | ||
279 | QSize srcSize = pixmap->image().size(); | 280 | | ||
280 | if (pixmap->surface() && pixmap->surface()->scale() == 1 && srcSize != toplevel->clientSize()) { | 281 | QRect src; | ||
282 | if (qobject_cast<Client*>(toplevel)) { | ||||
281 | // special case for XWayland windows | 283 | // special case for XWayland windows | ||
282 | srcSize = toplevel->clientSize(); | 284 | const auto scale = pixmap->surface()->scale(); | ||
285 | src = QRect((toplevel->clientPos() + toplevel->clientContentPos()) * scale, toplevel->clientSize() * scale); | ||||
286 | painter->setRenderHint(QPainter::SmoothPixmapTransform); | ||||
davidedmundson: I would expect one of the QPainter::setRenderHints will fix this. | |||||
You expected correctly. :) The Antialising one didn't help, but SmoothPixmapTransform did. romangg: You expected correctly. :)
The Antialising one didn't help, but SmoothPixmapTransform did. | |||||
Cool, that's relevant with just wayland scaling so you can ship a line adding that in a separate patch and I'll approve. davidedmundson: Cool, that's relevant with just wayland scaling so you can ship a line adding that in a… | |||||
I think we can just do this once at the start of the scene paint. If pixmap sizes match it won't have any performance impact - and I think it should still be relevant for wayland on wayland if the client scale doesn't match the output scale. davidedmundson: I think we can just do this once at the start of the scene paint.
If pixmap sizes match it… | |||||
287 | } else { | ||||
288 | src = QRect(toplevel->clientPos() + toplevel->clientContentPos(), pixmap->image().size()); | ||||
283 | } | 289 | } | ||
284 | const QRect src = QRect(toplevel->clientPos() + toplevel->clientContentPos(), srcSize); | 290 | | ||
285 | painter->drawImage(target, pixmap->image(), src); | 291 | painter->drawImage(target, pixmap->image(), src); | ||
286 | 292 | | |||
287 | // render subsurfaces | 293 | // render subsurfaces | ||
288 | const auto &children = pixmap->children(); | 294 | const auto &children = pixmap->children(); | ||
289 | for (auto pixmap : children) { | 295 | for (auto pixmap : children) { | ||
290 | if (pixmap->subSurface().isNull() || pixmap->subSurface()->surface().isNull() || !pixmap->subSurface()->surface()->isMapped()) { | 296 | if (pixmap->subSurface().isNull() || pixmap->subSurface()->surface().isNull() || !pixmap->subSurface()->surface()->isMapped()) { | ||
291 | continue; | 297 | continue; | ||
292 | } | 298 | } | ||
▲ Show 20 Lines • Show All 596 Lines • Show Last 20 Lines |
I would expect one of the QPainter::setRenderHints will fix this.