From ac6590e0fce6753c24e58564a09ea98545862b35 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 2 Mar 2018 13:22:06 +0100 Subject: 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 --- src/plugins/platforms/windows/qwindowsglcontext.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/plugins/platforms/windows') diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index 4bdf3167e4..e9c52e2c02 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -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) -- cgit v1.2.3