scenes/opengl: Fix clipping with transformed screens

Software-based clipping is naive. It maps the clip region from the
global screen coordinates and intersects it with window quads. If the
window is transformed, the quads won't be clipped as expected.

Unfortunately, the OpenGL scene enables software-based geometry clipping
if the screen transformed. It's not clear why it does so, perhaps as a
performance optimization? Either way, this produces incorrect results
when the screen is scaled.

BUG: 440940
This commit is contained in:
Vlad Zahorodnii 2021-09-23 16:23:08 +03:00
parent 242de43737
commit 0f6aa1c4a8

View file

@ -1023,7 +1023,7 @@ void OpenGLWindow::performPaint(int mask, const QRegion &region, const WindowPai
RenderContext renderContext {
.clip = region,
.paintData = data,
.hardwareClipping = region != infiniteRegion() && (mask & Scene::PAINT_WINDOW_TRANSFORMED) && !(mask & Scene::PAINT_SCREEN_TRANSFORMED),
.hardwareClipping = region != infiniteRegion() && ((mask & Scene::PAINT_WINDOW_TRANSFORMED) || (mask & Scene::PAINT_SCREEN_TRANSFORMED)),
};
renderContext.transforms.push(QMatrix4x4());