Avoid converting screenshot readback to ARGB32

OpenGL writes pixels as GL_RGBA, but the buffer is declared as QImage::Format_ARGB32_Premultiplied, so KWin manually iterates over the entire image and swaps the red and blue channels, with separate byte-order handling.

The conversion to QImage::Format_ARGB32_Premultiplied is not needed at all. Modern Qt supports the byte-ordered QImage::Format_RGBA8888_Premultiplied, so after reading the data from OpenGL, KWin now only flips the image vertically (and this could potentially be improved in the future as well).

Edited by Nate Graham

Merge request reports

Loading