Consider the opaque region for direct scanout

This commit is contained in:
Xaver Hugl 2021-03-18 23:14:46 +01:00
parent 6569bf80c3
commit 38a15996f4

View file

@ -641,7 +641,7 @@ void SceneOpenGL::paint(int screenId, const QRegion &damage, const QList<Topleve
Toplevel *toplevel = window->window();
if (toplevel->isOnScreen(screenId) && window->isVisible() && toplevel->opacity() > 0) {
AbstractClient *c = dynamic_cast<AbstractClient*>(toplevel);
if (!c || !c->isFullScreen() || !window->isOpaque()) {
if (!c || !c->isFullScreen()) {
break;
}
auto pixmap = window->windowPixmap<WindowPixmap>();
@ -654,6 +654,10 @@ void SceneOpenGL::paint(int screenId, const QRegion &damage, const QList<Topleve
if (pixmap->position() != QPoint(0, 0)) {
break;
}
// and it has to be completely opaque
if (!window->isOpaque() && !pixmap->opaque().contains(QRect(0, 0, window->width(), window->height()))) {
break;
}
directScanout = m_backend->scanout(screenId, pixmap->surface());
break;
}