From 8aae3bd438c9cd6c37610ae4383f6c075cd74001 Mon Sep 17 00:00:00 2001 From: Hatem ElKharashy Date: Wed, 10 Apr 2024 16:38:56 +0300 Subject: [PATCH] Tweak the margin value of QOutlineMapper clip rect The original change was introduced to fix performance regression due to the increased value of QT_RASTER_COORD_LIMIT. The optimization was done by clipping anything outside the device rect plus a small margin. However, setting the margin to a small value caused a regression, where the rasterization became slightly different from the previous implementation. Fixes: QTBUG-123054 Pick-to: 6.5 6.2 Change-Id: Ic4fddea89cd5f6e5760dc4a91b1f2f59527e8e5c Reviewed-by: Eirik Aavitsland (cherry picked from commit aabb133d07ff99157ae2070e16594eba035cca08) Reviewed-by: Qt Cherry-pick Bot --- src/gui/painting/qoutlinemapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp index 93eac5cced5..2f87ff43b79 100644 --- a/src/gui/painting/qoutlinemapper.cpp +++ b/src/gui/painting/qoutlinemapper.cpp @@ -50,7 +50,7 @@ void QOutlineMapper::setClipRect(QRect clipRect) if (clipRect != m_clip_rect) { m_clip_rect = limitCoords(clipRect); - const int mw = 64; // margin width. No need to trigger clipping for slight overshooting + const int mw = 1 << 10; // margin width. No need to trigger clipping for slight overshooting m_clip_trigger_rect = QRectF(limitCoords(m_clip_rect.adjusted(-mw, -mw, mw, mw))); } }