From aeefa4897faba85ad1c26cd44de18957d078fdef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 7 Jan 2013 18:21:55 +0100 Subject: Don't assume QSurfaceFormat's stencil buffer size is >= 0 The value -1 is used to indicate no stencil buffer, so we have to check for sizes <= 0 when deciding whether or not to triangulate the path in QOpenGL2PaintEngineExPrivate::fill(). This fixes an issue where filling a path would end up filling the whole outline of the path, which was very visible with fonts over a certain size (when we go from using the glyph cache to drawing filled paths for each glyph). Change-Id: Iafa96124481936db1e5109bba6166a6038c7ca83 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/opengl/qopenglpaintengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp index 624eeaffd9..596ef10f6e 100644 --- a/src/gui/opengl/qopenglpaintengine.cpp +++ b/src/gui/opengl/qopenglpaintengine.cpp @@ -877,7 +877,7 @@ void QOpenGL2PaintEngineExPrivate::fill(const QVectorPath& path) // Tag it for later so that if the same path is drawn twice, it is assumed to be static and thus cachable path.makeCacheable(); - if (device->context()->format().stencilBufferSize() == 0) { + if (device->context()->format().stencilBufferSize() <= 0) { // If there is no stencil buffer, triangulate the path instead. QRectF bbox = path.controlPointRect(); -- cgit v1.2.3