summaryrefslogtreecommitdiffstats
path: root/src/opengl/qopengltextureglyphcache.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-04-14 13:48:28 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-04-17 11:50:24 +0200
commitad5aee2e34fad45d1d90bb059fa00a791d4ba3e2 (patch)
tree0df5be078e937caf0cec39b312449128300735dc /src/opengl/qopengltextureglyphcache.cpp
parent009d583eef20e7732225cdeae32925ac676d3a47 (diff)
Get rid of QT_OPENGL_ES*
The QT_OPENGL_ES* macros are leftovers from an earlier, ad hoc configuration system, which has since been replaced by QT_CONFIG. To clean things up in Qt 6, we use the new way instead. Task-number: QTBUG-83467 Change-Id: I578dc7695bff9d5ee303b22e44f60fee22fe0c28 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/opengl/qopengltextureglyphcache.cpp')
-rw-r--r--src/opengl/qopengltextureglyphcache.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/opengl/qopengltextureglyphcache.cpp b/src/opengl/qopengltextureglyphcache.cpp
index 66fd3a7507..a38d4328cc 100644
--- a/src/opengl/qopengltextureglyphcache.cpp
+++ b/src/opengl/qopengltextureglyphcache.cpp
@@ -92,7 +92,7 @@ QOpenGLTextureGlyphCache::~QOpenGLTextureGlyphCache()
clear();
}
-#if !defined(QT_OPENGL_ES_2)
+#if !QT_CONFIG(opengles2)
static inline bool isCoreProfile()
{
return QOpenGLContext::currentContext()->format().profile() == QSurfaceFormat::CoreProfile;
@@ -143,7 +143,7 @@ void QOpenGLTextureGlyphCache::createTextureData(int width, int height)
QVarLengthArray<uchar> data(width * height);
for (int i = 0; i < data.size(); ++i)
data[i] = 0;
-#if !defined(QT_OPENGL_ES_2)
+#if !QT_CONFIG(opengles2)
const GLint internalFormat = isCoreProfile() ? GL_R8 : GL_ALPHA;
const GLenum format = isCoreProfile() ? GL_RED : GL_ALPHA;
#else
@@ -233,11 +233,11 @@ static void load_glyph_image_to_texture(QOpenGLContext *ctx,
funcs->glBindTexture(GL_TEXTURE_2D, texture);
if (img.depth() == 32) {
-#ifdef QT_OPENGL_ES_2
+#if QT_CONFIG(opengles2)
GLenum fmt = GL_RGBA;
#else
GLenum fmt = ctx->isOpenGLES() ? GL_RGBA : GL_BGRA;
-#endif // QT_OPENGL_ES_2
+#endif // QT_CONFIG(opengles2)
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
fmt = GL_RGBA;
@@ -246,7 +246,7 @@ static void load_glyph_image_to_texture(QOpenGLContext *ctx,
} else {
// The scanlines in image are 32-bit aligned, even for mono or 8-bit formats. This
// is good because it matches the default of 4 bytes for GL_UNPACK_ALIGNMENT.
-#if !defined(QT_OPENGL_ES_2)
+#if !QT_CONFIG(opengles2)
const GLenum format = isCoreProfile() ? GL_RED : GL_ALPHA;
#else
const GLenum format = GL_ALPHA;