Changeset View
Changeset View
Standalone View
Standalone View
plugins/scenes/qpainter/scene_qpainter.cpp
Show First 20 Lines • Show All 396 Lines • ▼ Show 20 Line(s) | |||||
397 | { | 397 | { | ||
398 | if (isValid()) { | 398 | if (isValid()) { | ||
399 | return; | 399 | return; | ||
400 | } | 400 | } | ||
401 | KWin::WindowPixmap::create(); | 401 | KWin::WindowPixmap::create(); | ||
402 | if (!isValid()) { | 402 | if (!isValid()) { | ||
403 | return; | 403 | return; | ||
404 | } | 404 | } | ||
405 | if (!surface()) { | ||||
406 | // That's an internal client. | ||||
romangg: Why can't it be an X client? | |||||
Are you talking about the case when a Client doesn't have a surface assigned to it yet? zzag: Are you talking about the case when a Client doesn't have a surface assigned to it yet? | |||||
If you are indeed talking about that case, then I'd say we don't need to worry about it because the pixmap won't be valid. zzag: If you are indeed talking about that case, then I'd say we don't need to worry about it because… | |||||
Nah, I was just overlooking that it's the QPainter backend, which is only available on Wayland. romangg: Nah, I was just overlooking that it's the QPainter backend, which is only available on Wayland. | |||||
407 | m_image = internalImage(); | ||||
408 | return; | ||||
409 | } | ||||
405 | // performing deep copy, this could probably be improved | 410 | // performing deep copy, this could probably be improved | ||
406 | m_image = buffer()->data().copy(); | 411 | m_image = buffer()->data().copy(); | ||
407 | if (auto s = surface()) { | 412 | if (auto s = surface()) { | ||
408 | s->resetTrackedDamage(); | 413 | s->resetTrackedDamage(); | ||
409 | } | 414 | } | ||
410 | } | 415 | } | ||
411 | 416 | | |||
412 | WindowPixmap *QPainterWindowPixmap::createChild(const QPointer<KWayland::Server::SubSurfaceInterface> &subSurface) | 417 | WindowPixmap *QPainterWindowPixmap::createChild(const QPointer<KWayland::Server::SubSurfaceInterface> &subSurface) | ||
413 | { | 418 | { | ||
414 | return new QPainterWindowPixmap(subSurface, this); | 419 | return new QPainterWindowPixmap(subSurface, this); | ||
415 | } | 420 | } | ||
416 | 421 | | |||
417 | void QPainterWindowPixmap::updateBuffer() | 422 | void QPainterWindowPixmap::updateBuffer() | ||
418 | { | 423 | { | ||
419 | const auto oldBuffer = buffer(); | 424 | const auto oldBuffer = buffer(); | ||
420 | WindowPixmap::updateBuffer(); | 425 | WindowPixmap::updateBuffer(); | ||
421 | const auto &b = buffer(); | 426 | const auto &b = buffer(); | ||
427 | if (!surface()) { | ||||
428 | // That's an internal client. | ||||
429 | m_image = internalImage(); | ||||
430 | return; | ||||
431 | } | ||||
422 | if (b.isNull()) { | 432 | if (b.isNull()) { | ||
423 | m_image = QImage(); | 433 | m_image = QImage(); | ||
424 | return; | 434 | return; | ||
425 | } | 435 | } | ||
426 | if (b == oldBuffer) { | 436 | if (b == oldBuffer) { | ||
427 | return; | 437 | return; | ||
428 | } | 438 | } | ||
429 | // perform deep copy | 439 | // perform deep copy | ||
▲ Show 20 Lines • Show All 449 Lines • Show Last 20 Lines |
Why can't it be an X client?