Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.2.0
-
None
Description
The following code in QEglFSCompositor::render does not correctly map a rectangle onto the -1 to +1 range. The right-hand x value is not width, but width-1 - this results in an upper value slightly smaller than 1. In turn, this can causes texture sampling errors near the center of the screen since nearest sampling is being employed.
GLfloat x1 = (tl.x() / sr.width()) * 2 - 1; GLfloat x2 = (br.x() / sr.width()) * 2 - 1; GLfloat y1 = ((sr.height() - tl.y()) / sr.height()) * 2 - 1; GLfloat y2 = ((sr.height() - br.y()) / sr.height()) * 2 - 1;
I have tested the following fix which works well:
GLfloat x1 = (tl.x() / sr.width()) * 2 - 1; GLfloat x2 = ((br.x() + 1) / sr.width()) * 2 - 1; GLfloat y1 = ((sr.height() - tl.y()) / sr.height()) * 2 - 1; GLfloat y2 = ((sr.height() - (br.y() + 1)) / sr.height()) * 2 - 1;
The problem was very noticeable when a full screen of small text was being displayed at 1920x1080 or 1280x720. A vertical and horizontal line of sampling artifacts (showing as smudged text) was visible through the center of the screen.
Attachments
For Gerrit Dashboard: QTBUG-36370 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
76358,1 | eglfs: Fix quad coordinates | dev | qt/qtbase | Status: MERGED | +2 | 0 |