Windows QPA: GL: Fix setting the color depths for the GDI fallback

Set the color buffer depths on the PIXELFORMATDESCRIPTOR for
the fallback code path (-platform windows:gl=gdi).

Task-number: QTBUG-66797
Change-Id: Idccd94fdf121803af1c19e34cc86b6f06ca88d90
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
bb10
Friedemann Kleint 2018-03-02 13:22:06 +01:00
parent 88a48192aa
commit ac6590e0fc
1 changed files with 9 additions and 0 deletions

View File

@ -391,6 +391,15 @@ static PIXELFORMATDESCRIPTOR
pfd.dwFlags |= PFD_DOUBLEBUFFER;
pfd.cDepthBits =
format.depthBufferSize() >= 0 ? format.depthBufferSize() : 32;
const int redBufferSize = format.redBufferSize();
if (redBufferSize != -1)
pfd.cRedBits = BYTE(redBufferSize);
const int greenBufferSize = format.greenBufferSize();
if (greenBufferSize != -1)
pfd.cGreenBits = BYTE(greenBufferSize);
const int blueBufferSize = format.blueBufferSize();
if (blueBufferSize != -1)
pfd.cBlueBits = BYTE(blueBufferSize);
pfd.cAlphaBits = format.alphaBufferSize() > 0 ? format.alphaBufferSize() : 8;
pfd.cStencilBits = format.stencilBufferSize() > 0 ? format.stencilBufferSize() : 8;
if (additional.formatFlags & QWindowsGLAccumBuffer)