summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesus Fernandez <jesus.fernandez@qt.io>2018-02-27 14:18:02 +0100
committerJesus Fernandez <Jesus.Fernandez@qt.io>2018-03-09 15:49:34 +0000
commita4e460a01f1962317093a5fb2170c869aead954a (patch)
treebb22819eb1e9cbb2ee5b41f79211bb1024e2506b
parentd73338df3809c8551f387c7192725683d52746d8 (diff)
Allow customizing the maximum texture sizev5.11.0-beta2
Adds a new environment variable, QT_WEBGL_MAX_TEXTURE_SIZE, to configure the maximum texture size. The maximum value was hardcoded to 512 to save bandwidth, but it was giving problems when a high number of glyphs need to be stored in the GPU. After this patch, the maximum texture size allowed by WebGL will be used. The user can set the value to a custom value to optimize the bandwidth if the default value is too high, text rendering issues can happen. [ChangeLog][QWebGLContext] Fix text rendering issues when a lot of different glyphs are used. [ChangeLog][QWebGLContext] QT_WEBGL_MAX_TEXTURE_SIZE environment variable added to customize the maximum texture size. Task-number: QTBUG-66682 Change-Id: Id8a46daf4718a76fcf7d6a2c2cf831f3d6db372d Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
-rw-r--r--src/plugins/platforms/webgl/qwebglcontext.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/platforms/webgl/qwebglcontext.cpp b/src/plugins/platforms/webgl/qwebglcontext.cpp
index fb5ff03..397e26f 100644
--- a/src/plugins/platforms/webgl/qwebglcontext.cpp
+++ b/src/plugins/platforms/webgl/qwebglcontext.cpp
@@ -871,8 +871,12 @@ QWEBGL_FUNCTION(getIntegerv, void, glGetIntegerv,
(GLenum) pname, (GLint *) data)
{
if (pname == GL_MAX_TEXTURE_SIZE) {
- *data = 512;
- return;
+ static bool ok;
+ static auto value = qgetenv("QT_WEBGL_MAX_TEXTURE_SIZE").toUInt(&ok);
+ if (ok) {
+ *data = value;
+ return;
+ }
}
const auto it = currentContextData()->cachedParameters.find(pname);
if (it != currentContextData()->cachedParameters.end()) {