diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-02-26 17:32:33 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-28 18:00:44 +0100 |
commit | 5119bbc6424742860abafe7a371fa5234f03eabb (patch) | |
tree | 0e6aa1e0380975c00e9aadd8b46d4623b0233b2d /src/gui/opengl/qopengltextureglyphcache.cpp | |
parent | 1219dbe543eb91a52645cd96e6b7eccfd60b5be7 (diff) |
Add core profile versions of the glyph cache shaders
The last step to make QOpenGLTextureGlyphCache working with
OpenGL core profiles.
[ChangeLog] Native (that is, not distance field based) text
rendering is now functional on OpenGL 3.2+ core profiles too.
Task-number: QTBUG-36993
Change-Id: Ic6c0db4806cea623ca7a19ab77b0329155824877
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/gui/opengl/qopengltextureglyphcache.cpp')
-rw-r--r-- | src/gui/opengl/qopengltextureglyphcache.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp index 3524c1cb1a..356f68b49b 100644 --- a/src/gui/opengl/qopengltextureglyphcache.cpp +++ b/src/gui/opengl/qopengltextureglyphcache.cpp @@ -248,11 +248,12 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height) if (pex == 0) { if (m_blitProgram == 0) { m_blitProgram = new QOpenGLShaderProgram(ctx); + const bool isCoreProfile = ctx->format().profile() == QSurfaceFormat::CoreProfile; { QString source; - source.append(QLatin1String(qopenglslMainWithTexCoordsVertexShader)); - source.append(QLatin1String(qopenglslUntransformedPositionVertexShader)); + source.append(QLatin1String(isCoreProfile ? qopenglslMainWithTexCoordsVertexShader_core : qopenglslMainWithTexCoordsVertexShader)); + source.append(QLatin1String(isCoreProfile ? qopenglslUntransformedPositionVertexShader_core : qopenglslUntransformedPositionVertexShader)); QOpenGLShader *vertexShader = new QOpenGLShader(QOpenGLShader::Vertex, m_blitProgram); vertexShader->compileSourceCode(source); @@ -262,8 +263,8 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height) { QString source; - source.append(QLatin1String(qopenglslMainFragmentShader)); - source.append(QLatin1String(qopenglslImageSrcFragmentShader)); + source.append(QLatin1String(isCoreProfile ? qopenglslMainFragmentShader_core : qopenglslMainFragmentShader)); + source.append(QLatin1String(isCoreProfile ? qopenglslImageSrcFragmentShader_core : qopenglslImageSrcFragmentShader)); QOpenGLShader *fragmentShader = new QOpenGLShader(QOpenGLShader::Fragment, m_blitProgram); fragmentShader->compileSourceCode(source); |