Fix QXcbScreen::format() when rgb-swap is needed

QXcbScreen::format() was producing console warning and returning invalid
format if rgb-swap was necessary. Let it match possibly reversed formats
since the backing-store will swizzle it anyway.

Change-Id: I6a53cb8ceda029e9d708d25ad635832f1163ffe7
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
Allan Sandfeld Jensen 2018-02-27 09:42:49 +01:00
parent daa39f8499
commit 635b5115c4

View File

@ -583,7 +583,9 @@ QRect QXcbScreen::availableGeometry() const
QImage::Format QXcbScreen::format() const
{
QImage::Format format;
qt_xcb_imageFormatForVisual(connection(), screen()->root_depth, visualForId(screen()->root_visual), &format);
bool needsRgbSwap;
qt_xcb_imageFormatForVisual(connection(), screen()->root_depth, visualForId(screen()->root_visual), &format, &needsRgbSwap);
// We are ignoring needsRgbSwap here and just assumes the backing-store will handle it.
return format;
}