diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-03-12 13:38:24 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-15 10:45:10 +0100 |
commit | 3d2160056e409ad2508a8bff4288944d37e32f85 (patch) | |
tree | 03e4cc4ccc354066796b2536acb2a5e74e142d56 /src/opengl/gl2paintengineex/qglengineshadersource_p.h | |
parent | 77bf302ce2d69fb01e41b02329fdb8419b6e9e52 (diff) |
Resurrect QGLWidget::renderText()
The variant taking x, y, z has been broken in all Qt 5.x releases.
This is now corrected by making the GL2 paint engine capable of applying
a Z translation.
Task-number: QTBUG-31156
Change-Id: I119566e9e9577f6cdf7e8bae56cac1e34995e622
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/opengl/gl2paintengineex/qglengineshadersource_p.h')
-rw-r--r-- | src/opengl/gl2paintengineex/qglengineshadersource_p.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h index 90bd7edf54..aad2c1f7db 100644 --- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h @@ -106,10 +106,13 @@ static const char* const qglslPositionOnlyVertexShader = "\n\ static const char* const qglslComplexGeometryPositionOnlyVertexShader = "\n\ uniform highp mat3 matrix; \n\ + uniform highp float translateZ; \n\ attribute highp vec2 vertexCoordsArray; \n\ void setPosition(void) \n\ { \n\ - gl_Position = vec4(matrix * vec3(vertexCoordsArray, 1), 1);\n\ + vec3 v = matrix * vec3(vertexCoordsArray, 1.0); \n\ + vec4 vz = mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, translateZ, 1) * vec4(v, 1.0); \n\ + gl_Position = vec4(vz.xyz, 1.0);\n\ } \n"; static const char* const qglslUntransformedPositionVertexShader = "\n\ |