summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp2
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp20
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp4
-rw-r--r--src/opengl/qgl.cpp40
-rw-r--r--src/opengl/qgl_qpa.cpp2
-rw-r--r--src/opengl/qglframebufferobject.cpp14
-rw-r--r--src/opengl/qglframebufferobject_p.h2
-rw-r--r--src/opengl/qglfunctions.cpp2
-rw-r--r--src/opengl/qglpixelbuffer.cpp6
-rw-r--r--src/opengl/qglshaderprogram.cpp12
10 files changed, 62 insertions, 42 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
index f266318ba6..19e453e783 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
@@ -163,7 +163,7 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context)
code[NonPremultipliedImageSrcFragmentShader] = qglslNonPremultipliedImageSrcFragmentShader;
code[CustomImageSrcFragmentShader] = qglslCustomSrcFragmentShader; // Calls "customShader", which must be appended
code[SolidBrushSrcFragmentShader] = qglslSolidBrushSrcFragmentShader;
- if (!context->contextHandle()->isES())
+ if (!context->contextHandle()->isOpenGLES())
code[TextureBrushSrcFragmentShader] = qglslTextureBrushSrcFragmentShader_desktop;
else
code[TextureBrushSrcFragmentShader] = qglslTextureBrushSrcFragmentShader_ES;
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 162ae9fe79..5045d4a2ae 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -227,11 +227,19 @@ void QGL2PaintEngineExPrivate::updateBrushTexture()
if (currentBrushPixmap.width() > max_texture_size || currentBrushPixmap.height() > max_texture_size)
currentBrushPixmap = currentBrushPixmap.scaled(max_texture_size, max_texture_size, Qt::KeepAspectRatio);
+ GLuint wrapMode = GL_REPEAT;
+ if (ctx->contextHandle()->isOpenGLES()) {
+ // OpenGL ES does not support GL_REPEAT wrap modes for NPOT textures. So instead,
+ // we emulate GL_REPEAT by only taking the fractional part of the texture coords
+ // in the qopenglslTextureBrushSrcFragmentShader program.
+ wrapMode = GL_CLAMP_TO_EDGE;
+ }
+
glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
QGLTexture *tex = ctx->d_func()->bindTexture(currentBrushPixmap, GL_TEXTURE_2D, GL_RGBA,
QGLContext::InternalBindOption |
QGLContext::CanFlipNativePixmapBindOption);
- updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform);
+ updateTextureFilter(GL_TEXTURE_2D, wrapMode, q->state()->renderHints & QPainter::SmoothPixmapTransform);
textureInvertedY = tex->options & QGLContext::InvertedYBindOption ? -1 : 1;
}
brushTextureDirty = false;
@@ -543,7 +551,7 @@ void QGL2PaintEngineEx::beginNativePainting()
d->glDisableVertexAttribArray(i);
#ifndef QT_OPENGL_ES_2
- if (!d->ctx->contextHandle()->isES()) {
+ if (!d->ctx->contextHandle()->isOpenGLES()) {
const QGLContext *ctx = d->ctx;
const QGLFormat &fmt = d->device->format();
if (fmt.majorVersion() < 3 || (fmt.majorVersion() == 3 && fmt.minorVersion() < 1)
@@ -604,7 +612,7 @@ void QGL2PaintEngineExPrivate::resetGLState()
ctx->d_func()->setVertexAttribArrayEnabled(QT_VERTEX_COORDS_ATTR, false);
ctx->d_func()->setVertexAttribArrayEnabled(QT_OPACITY_ATTR, false);
#ifndef QT_OPENGL_ES_2
- if (!ctx->contextHandle()->isES()) {
+ if (!ctx->contextHandle()->isOpenGLES()) {
// gl_Color, corresponding to vertex attribute 3, may have been changed
float color[] = { 1.0f, 1.0f, 1.0f, 1.0f };
glVertexAttrib4fv(3, color);
@@ -1371,7 +1379,7 @@ void QGL2PaintEngineEx::renderHintsChanged()
state()->renderHintsChanged = true;
#if !defined(QT_OPENGL_ES_2)
- if (!d->ctx->contextHandle()->isES()) {
+ if (!d->ctx->contextHandle()->isOpenGLES()) {
if ((state()->renderHints & QPainter::Antialiasing)
|| (state()->renderHints & QPainter::HighQualityAntialiasing))
d->glEnable(GL_MULTISAMPLE);
@@ -2047,14 +2055,14 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
d->glDisable(GL_SCISSOR_TEST);
#if !defined(QT_OPENGL_ES_2)
- if (!d->ctx->contextHandle()->isES())
+ if (!d->ctx->contextHandle()->isOpenGLES())
d->glDisable(GL_MULTISAMPLE);
#endif
d->glyphCacheFormat = QFontEngine::Format_A8;
#if !defined(QT_OPENGL_ES_2)
- if (!d->ctx->contextHandle()->isES()) {
+ if (!d->ctx->contextHandle()->isOpenGLES()) {
d->glyphCacheFormat = QFontEngine::Format_A32;
d->multisamplingAlwaysEnabled = false;
} else {
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index 01dfb38857..aa1d7decdb 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -320,7 +320,7 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed sub
uchar g = src[x] >> 8;
uchar b = src[x];
quint32 avg = (quint32(r) + quint32(g) + quint32(b) + 1) / 3; // "+1" for rounding.
- if (ctx->contextHandle()->isES()) {
+ if (ctx->contextHandle()->isOpenGLES()) {
// swizzle the bits to accommodate for the GL_RGBA upload.
src[x] = (avg << 24) | (quint32(r) << 0) | (quint32(g) << 8) | (quint32(b) << 16);
} else {
@@ -334,7 +334,7 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed sub
if (mask.format() == QImage::Format_RGB32) {
GLenum format = GL_RGBA;
#if !defined(QT_OPENGL_ES_2)
- if (!ctx->contextHandle()->isES())
+ if (!ctx->contextHandle()->isOpenGLES())
format = GL_BGRA;
#endif
funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, format, GL_UNSIGNED_BYTE, mask.bits());
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index f4bf8fd68b..f033b51edd 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1719,7 +1719,7 @@ QImage qt_gl_read_texture(const QSize &size, bool alpha_format, bool include_alp
int w = size.width();
int h = size.height();
#ifndef QT_OPENGL_ES
- if (!QOpenGLContext::currentContext()->isES()) {
+ if (!QOpenGLContext::currentContext()->isOpenGLES()) {
qgl1_functions()->glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, img.bits());
}
@@ -2305,7 +2305,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
funcs->glTexParameteri(target, GL_TEXTURE_MAG_FILTER, filtering);
QOpenGLContext *ctx = QOpenGLContext::currentContext();
- bool genMipmap = !ctx->isES();
+ bool genMipmap = !ctx->isOpenGLES();
if (glFormat.directRendering()
&& (qgl_extensions()->hasOpenGLExtension(QOpenGLExtensions::GenerateMipmap))
&& target == GL_TEXTURE_2D
@@ -2447,7 +2447,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
printf(" - did byte swapping (%d ms)\n", time.elapsed());
#endif
}
- if (ctx->isES()) {
+ if (ctx->isOpenGLES()) {
// OpenGL/ES requires that the internal and external formats be
// identical.
internalFormat = externalFormat;
@@ -2460,7 +2460,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
const QImage &constRef = img; // to avoid detach in bits()...
funcs->glTexImage2D(target, 0, internalFormat, img.width(), img.height(), 0, externalFormat,
pixel_type, constRef.bits());
- if (genMipmap && ctx->isES())
+ if (genMipmap && ctx->isOpenGLES())
q->functions()->glGenerateMipmap(target);
#ifndef QT_NO_DEBUG
GLenum error = funcs->glGetError();
@@ -2517,7 +2517,19 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target,
}
if (!texture) {
- QImage image = pixmap.toImage();
+ QImage image;
+ QPaintEngine* paintEngine = pixmap.paintEngine();
+ if (!paintEngine || paintEngine->type() != QPaintEngine::Raster)
+ image = pixmap.toImage();
+ else {
+ // QRasterPixmapData::toImage() will deep-copy the backing QImage if there's an active QPainter on it.
+ // For performance reasons, we don't want that here, so we temporarily redirect the paint engine.
+ QPaintDevice* currentPaintDevice = paintEngine->paintDevice();
+ paintEngine->setPaintDevice(0);
+ image = pixmap.toImage();
+ paintEngine->setPaintDevice(currentPaintDevice);
+ }
+
// If the system depth is 16 and the pixmap doesn't have an alpha channel
// then we convert it to RGB16 in the hope that it gets uploaded as a 16
// bit texture which is much faster to access than a 32-bit one.
@@ -2545,7 +2557,7 @@ int QGLContextPrivate::maxTextureSize()
#ifndef QT_OPENGL_ES
Q_Q(QGLContext);
- if (!q->contextHandle()->isES()) {
+ if (!q->contextHandle()->isOpenGLES()) {
GLenum proxy = GL_PROXY_TEXTURE_2D;
GLint size;
@@ -2725,7 +2737,7 @@ static void qDrawTextureRect(const QRectF &target, GLint textureWidth, GLint tex
Q_UNUSED(textureHeight);
Q_UNUSED(textureTarget);
#else
- if (textureTarget != GL_TEXTURE_2D && !QOpenGLContext::currentContext()->isES()) {
+ if (textureTarget != GL_TEXTURE_2D && !QOpenGLContext::currentContext()->isOpenGLES()) {
if (textureWidth == -1 || textureHeight == -1) {
QOpenGLFunctions_1_1 *gl1funcs = qgl1_functions();
gl1funcs->glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_WIDTH, &textureWidth);
@@ -2795,7 +2807,7 @@ void QGLContext::drawTexture(const QRectF &target, GLuint textureId, GLenum text
#ifndef QT_OPENGL_ES_2
QOpenGLFunctions *funcs = qgl_functions();
- if (!contextHandle()->isES()) {
+ if (!contextHandle()->isOpenGLES()) {
#ifdef QT_OPENGL_ES
if (textureTarget != GL_TEXTURE_2D) {
qWarning("QGLContext::drawTexture(): texture target must be GL_TEXTURE_2D on OpenGL ES");
@@ -2857,7 +2869,7 @@ void QGLContext::drawTexture(const QPointF &point, GLuint textureId, GLenum text
Q_UNUSED(textureId);
Q_UNUSED(textureTarget);
#else
- if (!contextHandle()->isES()) {
+ if (!contextHandle()->isOpenGLES()) {
QOpenGLFunctions *funcs = qgl_functions();
const bool wasEnabled = funcs->glIsEnabled(GL_TEXTURE_2D);
GLint oldTexture;
@@ -4163,7 +4175,7 @@ void QGLWidget::glDraw()
return;
makeCurrent();
#ifndef QT_OPENGL_ES
- if (d->glcx->deviceIsPixmap() && !d->glcx->contextHandle()->isES())
+ if (d->glcx->deviceIsPixmap() && !d->glcx->contextHandle()->isOpenGLES())
qgl1_functions()->glDrawBuffer(GL_FRONT);
#endif
QSize readback_target_size = d->glcx->d_ptr->readback_target_size;
@@ -4208,7 +4220,7 @@ void QGLWidget::qglColor(const QColor& c) const
#else
Q_D(const QGLWidget);
const QGLContext *ctx = QGLContext::currentContext();
- if (ctx && !ctx->contextHandle()->isES()) {
+ if (ctx && !ctx->contextHandle()->isOpenGLES()) {
if (ctx->format().rgba())
qgl1_functions()->glColor4f(c.redF(), c.greenF(), c.blueF(), c.alphaF());
else if (!d->cmap.isEmpty()) { // QGLColormap in use?
@@ -4240,7 +4252,7 @@ void QGLWidget::qglClearColor(const QColor& c) const
#else
Q_D(const QGLWidget);
const QGLContext *ctx = QGLContext::currentContext();
- if (ctx && !ctx->contextHandle()->isES()) {
+ if (ctx && !ctx->contextHandle()->isOpenGLES()) {
if (ctx->format().rgba())
qgl_functions()->glClearColor(c.redF(), c.greenF(), c.blueF(), c.alphaF());
else if (!d->cmap.isEmpty()) { // QGLColormap in use?
@@ -4420,7 +4432,7 @@ void QGLWidget::renderText(int x, int y, const QString &str, const QFont &font)
{
#ifndef QT_OPENGL_ES
Q_D(QGLWidget);
- if (!d->glcx->contextHandle()->isES()) {
+ if (!d->glcx->contextHandle()->isOpenGLES()) {
Q_D(QGLWidget);
if (str.isEmpty() || !isValid())
return;
@@ -4511,7 +4523,7 @@ void QGLWidget::renderText(double x, double y, double z, const QString &str, con
{
#ifndef QT_OPENGL_ES
Q_D(QGLWidget);
- if (!d->glcx->contextHandle()->isES()) {
+ if (!d->glcx->contextHandle()->isOpenGLES()) {
Q_D(QGLWidget);
if (str.isEmpty() || !isValid())
return;
diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp
index fbcc8a5adb..fbabbecdfb 100644
--- a/src/opengl/qgl_qpa.cpp
+++ b/src/opengl/qgl_qpa.cpp
@@ -326,7 +326,7 @@ QGLTemporaryContext::QGLTemporaryContext(bool, QWidget *)
d->context = new QOpenGLContext;
#if !defined(QT_OPENGL_ES)
- if (QOpenGLContext::openGLModuleType() == QOpenGLContext::DesktopGL) {
+ if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
// On desktop, request latest released version
QSurfaceFormat format;
#if defined(Q_OS_MAC)
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 050e47c372..cf8b75ce84 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -595,7 +595,7 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
GL_DEPTH_COMPONENT16, size.width(), size.height());
}
#else
- if (ctx->contextHandle()->isES()) {
+ if (ctx->contextHandle()->isOpenGLES()) {
if (funcs.hasOpenGLExtension(QOpenGLExtensions::Depth24))
funcs.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples,
GL_DEPTH_COMPONENT24, size.width(), size.height());
@@ -617,7 +617,7 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
size.width(), size.height());
}
#else
- if (ctx->contextHandle()->isES()) {
+ if (ctx->contextHandle()->isOpenGLES()) {
if (funcs.hasOpenGLExtension(QOpenGLExtensions::Depth24)) {
funcs.glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24,
size.width(), size.height());
@@ -647,7 +647,7 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
#ifdef QT_OPENGL_ES
GLenum storage = GL_STENCIL_INDEX8;
#else
- GLenum storage = ctx->contextHandle()->isES() ? GL_STENCIL_INDEX8 : GL_STENCIL_INDEX;
+ GLenum storage = ctx->contextHandle()->isOpenGLES() ? GL_STENCIL_INDEX8 : GL_STENCIL_INDEX;
#endif
if (samples != 0 && funcs.hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample))
@@ -849,7 +849,7 @@ QGLFramebufferObject::QGLFramebufferObject(const QSize &size, GLenum target)
Q_D(QGLFramebufferObject);
d->init(this, size, NoAttachment, target,
#ifndef QT_OPENGL_ES_2
- QOpenGLContext::currentContext()->isES() ? GL_RGBA : GL_RGBA8
+ QOpenGLContext::currentContext()->isOpenGLES() ? GL_RGBA : GL_RGBA8
#else
GL_RGBA
#endif
@@ -869,7 +869,7 @@ QGLFramebufferObject::QGLFramebufferObject(int width, int height, GLenum target)
Q_D(QGLFramebufferObject);
d->init(this, QSize(width, height), NoAttachment, target,
#ifndef QT_OPENGL_ES_2
- QOpenGLContext::currentContext()->isES() ? GL_RGBA : GL_RGBA8
+ QOpenGLContext::currentContext()->isOpenGLES() ? GL_RGBA : GL_RGBA8
#else
GL_RGBA
#endif
@@ -926,7 +926,7 @@ QGLFramebufferObject::QGLFramebufferObject(int width, int height, Attachment att
#ifdef QT_OPENGL_ES_2
internal_format = GL_RGBA;
#else
- internal_format = QOpenGLContext::currentContext()->isES() ? GL_RGBA : GL_RGBA8;
+ internal_format = QOpenGLContext::currentContext()->isOpenGLES() ? GL_RGBA : GL_RGBA8;
#endif
d->init(this, QSize(width, height), attachment, target, internal_format);
}
@@ -953,7 +953,7 @@ QGLFramebufferObject::QGLFramebufferObject(const QSize &size, Attachment attachm
#ifdef QT_OPENGL_ES_2
internal_format = GL_RGBA;
#else
- internal_format = QOpenGLContext::currentContext()->isES() ? GL_RGBA : GL_RGBA8;
+ internal_format = QOpenGLContext::currentContext()->isOpenGLES() ? GL_RGBA : GL_RGBA8;
#endif
d->init(this, size, attachment, target, internal_format);
}
diff --git a/src/opengl/qglframebufferobject_p.h b/src/opengl/qglframebufferobject_p.h
index 0edce5da2f..1aefa0b442 100644
--- a/src/opengl/qglframebufferobject_p.h
+++ b/src/opengl/qglframebufferobject_p.h
@@ -72,7 +72,7 @@ public:
{
#ifndef QT_OPENGL_ES_2
QOpenGLContext *ctx = QOpenGLContext::currentContext();
- const bool isES = ctx ? ctx->isES() : QOpenGLContext::openGLModuleType() != QOpenGLContext::DesktopGL;
+ const bool isES = ctx ? ctx->isOpenGLES() : QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGL;
internal_format = isES ? GL_RGBA : GL_RGBA8;
#else
internal_format = GL_RGBA;
diff --git a/src/opengl/qglfunctions.cpp b/src/opengl/qglfunctions.cpp
index 42b3b47f7f..5ad842bad4 100644
--- a/src/opengl/qglfunctions.cpp
+++ b/src/opengl/qglfunctions.cpp
@@ -223,7 +223,7 @@ QGLFunctions::QGLFunctions(const QGLContext *context)
static int qt_gl_resolve_features()
{
QOpenGLContext *ctx = QOpenGLContext::currentContext();
- if (ctx->isES()) {
+ if (ctx->isOpenGLES()) {
// OpenGL ES 2
int features = QGLFunctions::Multitexture |
QGLFunctions::Shaders |
diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp
index 8623f44ae1..18dbf4bdbb 100644
--- a/src/opengl/qglpixelbuffer.cpp
+++ b/src/opengl/qglpixelbuffer.cpp
@@ -361,7 +361,7 @@ void QGLPixelBuffer::updateDynamicTexture(GLuint texture_id) const
ctx->functions()->glBindTexture(GL_TEXTURE_2D, texture_id);
#ifndef QT_OPENGL_ES
- GLenum format = ctx->isES() ? GL_RGBA : GL_RGBA8;
+ GLenum format = ctx->isOpenGLES() ? GL_RGBA : GL_RGBA8;
ctx->functions()->glCopyTexImage2D(GL_TEXTURE_2D, 0, format, 0, 0, d->req_size.width(), d->req_size.height(), 0);
#else
ctx->functions()->glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, d->req_size.width(), d->req_size.height(), 0);
@@ -488,7 +488,7 @@ GLuint QGLPixelBuffer::bindTexture(const QImage &image, GLenum target)
{
Q_D(QGLPixelBuffer);
#ifndef QT_OPENGL_ES
- GLenum format = QOpenGLContext::currentContext()->isES() ? GL_RGBA : GL_RGBA8;
+ GLenum format = QOpenGLContext::currentContext()->isOpenGLES() ? GL_RGBA : GL_RGBA8;
return d->qctx->bindTexture(image, target, GLint(format));
#else
return d->qctx->bindTexture(image, target, GL_RGBA);
@@ -507,7 +507,7 @@ GLuint QGLPixelBuffer::bindTexture(const QPixmap &pixmap, GLenum target)
{
Q_D(QGLPixelBuffer);
#ifndef QT_OPENGL_ES
- GLenum format = QOpenGLContext::currentContext()->isES() ? GL_RGBA : GL_RGBA8;
+ GLenum format = QOpenGLContext::currentContext()->isOpenGLES() ? GL_RGBA : GL_RGBA8;
return d->qctx->bindTexture(pixmap, target, GLint(format));
#else
return d->qctx->bindTexture(pixmap, target, GL_RGBA);
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
index 5314db173e..9cd6ada058 100644
--- a/src/opengl/qglshaderprogram.cpp
+++ b/src/opengl/qglshaderprogram.cpp
@@ -248,7 +248,7 @@ bool QGLShaderPrivate::create()
shader = glfuncs->glCreateShader(GL_VERTEX_SHADER);
#if !defined(QT_OPENGL_ES_2)
else if (shaderType == QGLShader::Geometry
- && !context->contextHandle()->isES())
+ && !context->contextHandle()->isOpenGLES())
shader = glfuncs->glCreateShader(GL_GEOMETRY_SHADER_EXT);
#endif
else
@@ -430,14 +430,14 @@ bool QGLShader::compileSourceCode(const char *source)
srclen.append(GLint(headerLen));
}
#ifdef QGL_DEFINE_QUALIFIERS
- if (!QOpenGLContext::currentContext()->isES()) {
+ if (!QOpenGLContext::currentContext()->isOpenGLES()) {
src.append(qualifierDefines);
srclen.append(GLint(sizeof(qualifierDefines) - 1));
}
#endif
#ifdef QGL_REDEFINE_HIGHP
if (d->shaderType == Fragment
- && QOpenGLContext::currentContext()->isES()) {
+ && QOpenGLContext::currentContext()->isOpenGLES()) {
src.append(redefineHighp);
srclen.append(GLint(sizeof(redefineHighp) - 1));
}
@@ -568,7 +568,7 @@ public:
void initializeGeometryShaderFunctions()
{
QOpenGLContext *context = QOpenGLContext::currentContext();
- if (!context->isES()) {
+ if (!context->isOpenGLES()) {
glProgramParameteri = (type_glProgramParameteri)
context->getProcAddress("glProgramParameteri");
@@ -936,7 +936,7 @@ bool QGLShaderProgram::link()
#if !defined(QT_OPENGL_ES_2)
// Set up the geometry shader parameters
- if (!QOpenGLContext::currentContext()->isES()
+ if (!QOpenGLContext::currentContext()->isOpenGLES()
&& d->glfuncs->glProgramParameteri) {
foreach (QGLShader *shader, d->shaders) {
if (shader->shaderType() & QGLShader::Geometry) {
@@ -3075,7 +3075,7 @@ int QGLShaderProgram::maxGeometryOutputVertices() const
GLint n = 0;
#if !defined(QT_OPENGL_ES_2)
Q_D(const QGLShaderProgram);
- if (!QOpenGLContext::currentContext()->isES())
+ if (!QOpenGLContext::currentContext()->isOpenGLES())
d->glfuncs->glGetIntegerv(GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT, &n);
#endif
return n;