QGLTextureGlyphCache: Fix text rendering artifacts on NVIDIA

Check GL_VENDOR to test whether using NVIDIA graphics. On Linux,
GL_VERSION and GL_VENDOR contains "NVIDIA". On Windows, only
GL_VENDOR contains "NVIDIA".

Task-number: QTBUG-27658
Change-Id: I5e74d07ecb9522d1a86ac2953415a51bbdbe8c49
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
bb10
Jonathan Liu 2012-10-26 22:53:56 +11:00 committed by The Qt Project
parent 5bddaf76e0
commit 8900bc778f
1 changed files with 2 additions and 2 deletions

View File

@ -339,8 +339,8 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed sub
if (!ctx->d_ptr->workaround_brokenAlphaTexSubImage_init) {
// don't know which driver versions exhibit this bug, so be conservative for now
const QByteArray versionString(reinterpret_cast<const char*>(glGetString(GL_VERSION)));
ctx->d_ptr->workaround_brokenAlphaTexSubImage = versionString.indexOf("NVIDIA") >= 0;
const QByteArray vendorString(reinterpret_cast<const char*>(glGetString(GL_VENDOR)));
ctx->d_ptr->workaround_brokenAlphaTexSubImage = vendorString.indexOf("NVIDIA") >= 0;
ctx->d_ptr->workaround_brokenAlphaTexSubImage_init = true;
}