Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.9.0
-
For example Android Pixel XL has 3.5 device pixel ratio when Qt::AA_EnableHighDpiScaling is set.
-
6d471d6ec79c10e564f2c05bfac7ffab3560f54d
Description
QSGFramebufferObjectNode stores devicePixelRatio member variable as an integer while the values stored to it are qreal. If we have a non-integer device pixel ratio, this leads to problems in QQuickFramebufferObject::updatePaintNode() when we create the framebuffer object with createFramebufferObject(desiredFboSize), because the desiredFboSize is calculated using integer scale factor. The resulting framebuffer object has smaller size than desired.
The problem can be seen in qtdeclarative.git/tree/src/quick/items/qquickframebufferobject.cpp, lines 312, 313:
n->devicePixelRatio = window()->effectiveDevicePixelRatio(); desiredFboSize *= n->devicePixelRatio;
where window()->effectiveDevicePixelRatio(); returns qreal, but it is stored as int and then the desiredFboSize is calculated based on the integer value. Thus we think that the devicePixelRatio member variable should be qreal.
Attachments
For Gerrit Dashboard: QTBUG-61686 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
199193,2 | QQuickFBO: Keep devicePixelRatio qreal as long as possible | 5.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |