From 0f6aa1c4a8c4a2d2b002bd2806ddb606e3d516ef Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 23 Sep 2021 16:23:08 +0300 Subject: [PATCH] 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 --- src/plugins/scenes/opengl/scene_opengl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/scenes/opengl/scene_opengl.cpp b/src/plugins/scenes/opengl/scene_opengl.cpp index aa899c68f2..c8e79979bd 100644 --- a/src/plugins/scenes/opengl/scene_opengl.cpp +++ b/src/plugins/scenes/opengl/scene_opengl.cpp @@ -1023,7 +1023,7 @@ void OpenGLWindow::performPaint(int mask, const QRegion ®ion, 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());