Changeset View
Changeset View
Standalone View
Standalone View
plugins/scenes/qpainter/scene_qpainter.cpp
Show First 20 Lines • Show All 265 Lines • ▼ Show 20 Line(s) | 265 | if (!(mask & (PAINT_WINDOW_TRANSFORMED | PAINT_SCREEN_TRANSFORMED))) | |||
---|---|---|---|---|---|
266 | region &= toplevel->visibleRect(); | 266 | region &= toplevel->visibleRect(); | ||
267 | 267 | | |||
268 | if (region.isEmpty()) | 268 | if (region.isEmpty()) | ||
269 | return; | 269 | return; | ||
270 | QPainterWindowPixmap *pixmap = windowPixmap<QPainterWindowPixmap>(); | 270 | QPainterWindowPixmap *pixmap = windowPixmap<QPainterWindowPixmap>(); | ||
271 | if (!pixmap || !pixmap->isValid()) { | 271 | if (!pixmap || !pixmap->isValid()) { | ||
272 | return; | 272 | return; | ||
273 | } | 273 | } | ||
274 | if (!toplevel->damage().isEmpty()) { | | |||
275 | pixmap->updateBuffer(); | | |||
276 | toplevel->resetDamage(); | 274 | toplevel->resetDamage(); | ||
277 | } | | |||
278 | 275 | | |||
279 | QPainter *scenePainter = m_scene->scenePainter(); | 276 | QPainter *scenePainter = m_scene->scenePainter(); | ||
280 | QPainter *painter = scenePainter; | 277 | QPainter *painter = scenePainter; | ||
281 | painter->save(); | 278 | painter->save(); | ||
282 | painter->setClipRegion(region); | 279 | painter->setClipRegion(region); | ||
283 | painter->setClipping(true); | 280 | painter->setClipping(true); | ||
284 | 281 | | |||
285 | painter->translate(x(), y()); | 282 | painter->translate(x(), y()); | ||
▲ Show 20 Lines • Show All 160 Lines • ▼ Show 20 Line(s) | 426 | { | |||
446 | } | 443 | } | ||
447 | } | 444 | } | ||
448 | 445 | | |||
449 | WindowPixmap *QPainterWindowPixmap::createChild(const QPointer<KWayland::Server::SubSurfaceInterface> &subSurface) | 446 | WindowPixmap *QPainterWindowPixmap::createChild(const QPointer<KWayland::Server::SubSurfaceInterface> &subSurface) | ||
450 | { | 447 | { | ||
451 | return new QPainterWindowPixmap(subSurface, this); | 448 | return new QPainterWindowPixmap(subSurface, this); | ||
452 | } | 449 | } | ||
453 | 450 | | |||
454 | void QPainterWindowPixmap::updateBuffer() | 451 | void QPainterWindowPixmap::update() | ||
455 | { | 452 | { | ||
456 | const auto oldBuffer = buffer(); | 453 | const auto oldBuffer = buffer(); | ||
457 | WindowPixmap::updateBuffer(); | 454 | WindowPixmap::update(); | ||
458 | const auto &b = buffer(); | 455 | const auto &b = buffer(); | ||
459 | if (!surface()) { | 456 | if (!surface()) { | ||
460 | // That's an internal client. | 457 | // That's an internal client. | ||
461 | m_image = internalImage(); | 458 | m_image = internalImage(); | ||
462 | return; | 459 | return; | ||
463 | } | 460 | } | ||
464 | if (b.isNull()) { | 461 | if (b.isNull()) { | ||
465 | m_image = QImage(); | 462 | m_image = QImage(); | ||
▲ Show 20 Lines • Show All 455 Lines • Show Last 20 Lines |