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 <eskil.abrahamsen-blomfeldt@digia.com>
This commit is contained in:
Tor Arne Vestbø 2013-01-07 18:21:55 +01:00 committed by The Qt Project
parent ad3536b7ad
commit aeefa4897f

View File

@ -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();