[Libreoffice-commits] core.git: vcl/source
Tor Lillqvist
tml at collabora.com
Tue Nov 10 00:59:59 PST 2015
vcl/source/opengl/OpenGLContext.cxx | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
New commits:
commit ecc421cab986a26fb250beba228cf0cb49fba5b0
Author: Tor Lillqvist <tml at collabora.com>
Date: Tue Nov 10 10:56:57 2015 +0200
Add some assertions and improve comments
Make sure the hardcoded indexes into the iAttributes array that we use
mean what they are supposed to.
Add comments about that, and fix one misleading comment.
Change-Id: Ibb748b00782db4fcaf34f6c717075f6aff50651e
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index f389f88..ed035cb 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -298,16 +298,22 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
};
if (!bUseDoubleBufferedRendering)
+ {
+ // Use asserts to make sure the iAttributes array is not changed without changing these ugly
+ // hardcode indexes into it.
+ assert(iAttributes[0] == WGL_DOUBLE_BUFFER_ARB);
iAttributes[1] = GL_FALSE;
+ }
if (bRequestVirtualDevice)
{
+ assert(iAttributes[2] == WGL_DRAW_TO_WINDOW_ARB);
iAttributes[2] = WGL_DRAW_TO_BITMAP_ARB;
}
bool bArbMultisampleSupported = true;
- // First we check to see if we can get a pixel format for 4 samples
+ // First we check to see if we can get a pixel format for 8 samples
valid = wglChoosePixelFormatARB(hDC, iAttributes, fAttributes, 1, &pixelFormat, &numFormats);
// If we returned true, and our format count is greater than 1
if (valid && numFormats >= 1)
@@ -320,7 +326,8 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
DestroyWindow(hWnd);
return bArbMultisampleSupported;
}
- // Our pixel format with 4 samples failed, test for 2 samples
+ // Our pixel format with 8 samples failed, test for 2 samples
+ assert(iAttributes[18] == WGL_SAMPLES_ARB);
iAttributes[19] = 2;
valid = wglChoosePixelFormatARB(hDC, iAttributes, fAttributes, 1, &pixelFormat, &numFormats);
if (valid && numFormats >= 1)
More information about the Libreoffice-commits
mailing list