Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
5.2.0
-
None
-
6f7d370adec3054656f36b0d2a0777a8a1df3602
Description
The optimized drawing to RGB32 and RGB16 behaves differently than the generic formats when handling an operation something that result in a semi-transparent result.
The basic example is to use QPainter::CompositionMode_Source to draw a ARGB32 image to RGB.
When drawing an image with qRgb(255,0,0,127) using QPainter::CompositionMode_Source it will on a RGB32 painter result in data that is qRgb(127,0,0,127) which may cause problems later as the alpha value is not 255, and the color has not been inverse premultiplied.
The same on a RGB16 will results in pixels of qRgb(123,0,0,255). Here the alpha value has been correctly set, but the color is still missing an inverse premultiply.
When drawing to any other opaque format that does not have optimized blending results, the result will be pixel of color qRgb(255, 0, 0, 255). Unpremultiplied and alpha forced to 255.
Solving this may be a problem, since the inverse premultiply is very expensive, and the RGB32 behavior might be expected by some code.