Skip to content

kwineffects: Fix potential image detaching

Vlad Zahorodnii requested to merge work/const-bits into master

QImage is implicitly shared. However, methods such as QImage::bits() may detach. In order to avoid the detach, one either needs make the image const or use QImage::constBits() method.

Currently, the GLTexture class uses QImage::bits() all over the place. It prevents implicit detaching by storing images in const variables. Such code is fragile. Adding an intermediate (optional) conversion step may result in odd performance regressions.

Merge request reports

Loading