summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/opengl')
-rw-r--r--src/gui/opengl/opengl.pri22
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp8
-rw-r--r--src/gui/opengl/qopenglgradientcache.cpp24
-rw-r--r--src/gui/opengl/qopenglpixeltransferoptions.h10
-rw-r--r--src/gui/opengl/qopengltexture.cpp144
-rw-r--r--src/gui/opengl/qopengltexture.h21
-rw-r--r--src/gui/opengl/qopengltexturecache.cpp30
-rw-r--r--src/gui/opengl/qopengltexturecache_p.h3
-rw-r--r--src/gui/opengl/qopengltextureglyphcache.cpp39
-rw-r--r--src/gui/opengl/qopengltexturehelper.cpp19
-rw-r--r--src/gui/opengl/qopengltexturehelper_p.h8
11 files changed, 237 insertions, 91 deletions
diff --git a/src/gui/opengl/opengl.pri b/src/gui/opengl/opengl.pri
index 8212c0981f..d249b855f5 100644
--- a/src/gui/opengl/opengl.pri
+++ b/src/gui/opengl/opengl.pri
@@ -53,6 +53,17 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
opengl/qopenglvertexarrayobject.cpp \
opengl/qopengldebug.cpp
+ !wince* {
+ HEADERS += opengl/qopengltexture.h \
+ opengl/qopengltexture_p.h \
+ opengl/qopengltexturehelper_p.h \
+ opengl/qopenglpixeltransferoptions.h
+
+ SOURCES += opengl/qopengltexture.cpp \
+ opengl/qopengltexturehelper.cpp \
+ opengl/qopenglpixeltransferoptions.cpp
+ }
+
!contains(QT_CONFIG, opengles2) {
HEADERS += opengl/qopenglfunctions_1_0.h \
opengl/qopenglfunctions_1_1.h \
@@ -77,11 +88,7 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
opengl/qopenglfunctions_4_2_compatibility.h \
opengl/qopenglfunctions_4_3_compatibility.h \
opengl/qopenglqueryhelper_p.h \
- opengl/qopengltimerquery.h \
- opengl/qopengltexture.h \
- opengl/qopengltexture_p.h \
- opengl/qopengltexturehelper_p.h \
- opengl/qopenglpixeltransferoptions.h
+ opengl/qopengltimerquery.h
SOURCES += opengl/qopenglfunctions_1_0.cpp \
opengl/qopenglfunctions_1_1.cpp \
@@ -105,10 +112,7 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
opengl/qopenglfunctions_4_1_compatibility.cpp \
opengl/qopenglfunctions_4_2_compatibility.cpp \
opengl/qopenglfunctions_4_3_compatibility.cpp \
- opengl/qopengltimerquery.cpp \
- opengl/qopengltexture.cpp \
- opengl/qopengltexturehelper.cpp \
- opengl/qopenglpixeltransferoptions.cpp
+ opengl/qopengltimerquery.cpp
}
contains(QT_CONFIG, opengles2) {
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index a4ed74637c..0e5a1327b0 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -347,6 +347,9 @@ static int qt_gl_resolve_extensions()
{
int extensions = 0;
QOpenGLExtensionMatcher extensionMatcher;
+ if (extensionMatcher.match("GL_EXT_bgra"))
+ extensions |= QOpenGLExtensions::BGRATextureFormat;
+
#if defined(QT_OPENGL_ES)
if (extensionMatcher.match("GL_OES_mapbuffer"))
extensions |= QOpenGLExtensions::MapBuffer;
@@ -356,10 +359,9 @@ static int qt_gl_resolve_extensions()
extensions |= QOpenGLExtensions::ElementIndexUint;
if (extensionMatcher.match("GL_OES_depth24"))
extensions |= QOpenGLExtensions::Depth24;
-
- if (extensionMatcher.match("GL_EXT_bgra"))
+ // TODO: Consider matching GL_APPLE_texture_format_BGRA8888 as well, but it needs testing.
+ if (extensionMatcher.match("GL_IMG_texture_format_BGRA8888") || extensionMatcher.match("GL_EXT_texture_format_BGRA8888"))
extensions |= QOpenGLExtensions::BGRATextureFormat;
-
#else
QSurfaceFormat format = QOpenGLContext::currentContext()->format();
extensions |= QOpenGLExtensions::ElementIndexUint | QOpenGLExtensions::MapBuffer;
diff --git a/src/gui/opengl/qopenglgradientcache.cpp b/src/gui/opengl/qopenglgradientcache.cpp
index b48e96cd98..9c4fbbe013 100644
--- a/src/gui/opengl/qopenglgradientcache.cpp
+++ b/src/gui/opengl/qopenglgradientcache.cpp
@@ -152,22 +152,6 @@ GLuint QOpenGL2GradientCache::addCacheElement(quint64 hash_val, const QGradient
}
-// GL's expects pixels in RGBA (when using GL_RGBA), bin-endian (ABGR on x86).
-// Qt always stores in ARGB reguardless of the byte-order the mancine uses.
-static inline uint qtToGlColor(uint c)
-{
- uint o;
-#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
- o = (c & 0xff00ff00) // alpha & green already in the right place
- | ((c >> 16) & 0x000000ff) // red
- | ((c << 16) & 0x00ff0000); // blue
-#else //Q_BIG_ENDIAN
- o = (c << 8)
- | ((c >> 24) & 0x000000ff);
-#endif // Q_BYTE_ORDER
- return o;
-}
-
//TODO: Let GL generate the texture using an FBO
void QOpenGL2GradientCache::generateGradientColorTable(const QGradient& gradient, uint *colorTable, int size, qreal opacity) const
{
@@ -184,7 +168,7 @@ void QOpenGL2GradientCache::generateGradientColorTable(const QGradient& gradient
uint current_color = ARGB_COMBINE_ALPHA(colors[0], alpha);
qreal incr = 1.0 / qreal(size);
qreal fpos = 1.5 * incr;
- colorTable[pos++] = qtToGlColor(PREMUL(current_color));
+ colorTable[pos++] = ARGB2RGBA(PREMUL(current_color));
while (fpos <= s.first().first) {
colorTable[pos] = colorTable[pos - 1];
@@ -205,9 +189,9 @@ void QOpenGL2GradientCache::generateGradientColorTable(const QGradient& gradient
int dist = int(256 * ((fpos - s[i].first) * delta));
int idist = 256 - dist;
if (colorInterpolation)
- colorTable[pos] = qtToGlColor(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist));
+ colorTable[pos] = ARGB2RGBA(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist));
else
- colorTable[pos] = qtToGlColor(PREMUL(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist)));
+ colorTable[pos] = ARGB2RGBA(PREMUL(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist)));
++pos;
fpos += incr;
}
@@ -216,7 +200,7 @@ void QOpenGL2GradientCache::generateGradientColorTable(const QGradient& gradient
Q_ASSERT(s.size() > 0);
- uint last_color = qtToGlColor(PREMUL(ARGB_COMBINE_ALPHA(colors[s.size() - 1], alpha)));
+ uint last_color = ARGB2RGBA(PREMUL(ARGB_COMBINE_ALPHA(colors[s.size() - 1], alpha)));
for (;pos < size; ++pos)
colorTable[pos] = last_color;
diff --git a/src/gui/opengl/qopenglpixeltransferoptions.h b/src/gui/opengl/qopenglpixeltransferoptions.h
index 1a5d3f00e2..c150e8aff4 100644
--- a/src/gui/opengl/qopenglpixeltransferoptions.h
+++ b/src/gui/opengl/qopenglpixeltransferoptions.h
@@ -60,6 +60,14 @@ public:
QOpenGLPixelTransferOptions &operator=(const QOpenGLPixelTransferOptions &);
~QOpenGLPixelTransferOptions();
+#ifdef Q_COMPILER_RVALUE_REFS
+ QOpenGLPixelTransferOptions &operator=(QOpenGLPixelTransferOptions &&other)
+ { swap(other); return *this; }
+#endif
+
+ void swap(QOpenGLPixelTransferOptions &other)
+ { data.swap(other.data); }
+
void setAlignment(int alignment);
int alignment() const;
@@ -88,6 +96,8 @@ private:
QSharedDataPointer<QOpenGLPixelTransferOptionsData> data;
};
+Q_DECLARE_SHARED(QOpenGLPixelTransferOptions)
+
QT_END_NAMESPACE
#endif // QT_NO_OPENGL
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index d5a7399c18..e3fffe5a1c 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -50,6 +50,11 @@
QT_BEGIN_NAMESPACE
+//this is to work around GL_TEXTURE_WRAP_R_OES which also has 0x8072 as value
+#if !defined(GL_TEXTURE_WRAP_R)
+ #define GL_TEXTURE_WRAP_R 0x8072
+#endif
+
QOpenGLTexturePrivate::QOpenGLTexturePrivate(QOpenGLTexture::Target textureTarget,
QOpenGLTexture *qq)
: q_ptr(qq),
@@ -1255,6 +1260,13 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target
\value SRGB_Alpha_DXT3 Equivalent to GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
\value SRGB_Alpha_DXT5 Equivalent to GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
\value SRGB_BP_UNorm Equivalent to GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
+
+ \value DepthFormat Equivalent to GL_DEPTH_COMPONENT (OpenGL ES 2 only and when OES_depth_texture is present)
+ \value AlphaFormat Equivalent to GL_ALPHA (OpenGL ES 2 only)
+ \value RGBFormat Equivalent to GL_RGB (OpenGL ES 2 only)
+ \value RGBAFormat Equivalent to GL_RGBA (OpenGL ES 2 only)
+ \value LuminanceFormat Equivalent to GL_LUMINANCE (OpenGL ES 2 only)
+ \value LuminanceAlphaFormat Equivalent to GL_LUMINANCE_ALPHA (OpenGL ES 2 only)
*/
/*!
@@ -1289,6 +1301,10 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target
\value BGRA_Integer Equivalent to GL_BGRA_INTEGER
\value Depth Equivalent to GL_DEPTH_COMPONENT
\value DepthStencil Equivalent to GL_DEPTH_STENCIL
+ \value Alpha Equivalent to GL_ALPHA (OpenGL ES 2 only)
+ \value Luminance Equivalent to GL_LUMINANCE (OpenGL ES 2 only)
+ \value LuminanceAlpha Equivalent to GL_LUMINANCE_ALPHA (OpenGL ES 2 only)
+
*/
/*!
@@ -1303,6 +1319,7 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target
\value Int32 Equivalent to GL_INT
\value UInt32 Equivalent to GL_UNSIGNED_INT
\value Float16 Equivalent to GL_HALF_FLOAT
+ \value Float16OES Equivalent to GL_HALF_FLOAT_OES
\value Float32 Equivalent to GL_FLOAT
\value UInt32_RGB9_E5 Equivalent to GL_UNSIGNED_INT_5_9_9_9_REV
\value UInt32_RG11B10F Equivalent to GL_UNSIGNED_INT_10F_11F_11F_REV
@@ -1752,6 +1769,12 @@ void QOpenGLTexture::setFormat(TextureFormat format)
case D32:
case D32F:
case D32FS8X24:
+ case DepthFormat:
+ case AlphaFormat:
+ case RGBFormat:
+ case RGBAFormat:
+ case LuminanceFormat:
+ case LuminanceAlphaFormat:
d->formatClass = FormatClass_Unique;
break;
}
@@ -1825,7 +1848,7 @@ void QOpenGLTexture::setSize(int width, int height, int depth)
/*!
Returns the width of a 1D, 2D or 3D texture.
- \sa height(), depth(), setDimensions()
+ \sa height(), depth(), setSize()
*/
int QOpenGLTexture::width() const
{
@@ -1836,7 +1859,7 @@ int QOpenGLTexture::width() const
/*!
Returns the height of a 2D or 3D texture.
- \sa width(), depth(), setDimensions()
+ \sa width(), depth(), setSize()
*/
int QOpenGLTexture::height() const
{
@@ -1847,7 +1870,7 @@ int QOpenGLTexture::height() const
/*!
Returns the depth of a 3D texture.
- \sa width(), height(), setDimensions()
+ \sa width(), height(), setSize()
*/
int QOpenGLTexture::depth() const
{
@@ -1913,7 +1936,7 @@ int QOpenGLTexture::mipLevels() const
Returns the maximum number of mipmap levels that this texture
can have given the current dimensions.
- \sa setMipLevels(), mipLevels(), setDimensions()
+ \sa setMipLevels(), mipLevels(), setSize()
*/
int QOpenGLTexture::maximumMipLevels() const
{
@@ -2018,7 +2041,7 @@ void QOpenGLTexture::allocateStorage()
The texture format, dimensions, mipmap levels and array layers
cannot be altered once storage ihas been allocated.
- \sa allocateStorage(), setDimensions(), setMipLevels(), setLayers(), setFormat()
+ \sa allocateStorage(), setSize(), setMipLevels(), setLayers(), setFormat()
*/
bool QOpenGLTexture::isStorageAllocated() const
{
@@ -2242,6 +2265,7 @@ bool QOpenGLTexture::hasFeature(Feature feature)
bool supported = false;
switch (feature) {
+#if !defined(QT_OPENGL_ES_2)
case ImmutableMultisampleStorage:
case TextureBuffer:
case StencilTexturing:
@@ -2289,16 +2313,38 @@ bool QOpenGLTexture::hasFeature(Feature feature)
break;
}
+#else
+ case Texture3D:
+ supported = ctx->hasExtension(QByteArrayLiteral("GL_OES_texture_3D"));
+ break;
+ case AnisotropicFiltering:
+ supported = ctx->hasExtension(QByteArrayLiteral("GL_EXT_texture_filter_anisotropic"));
+ break;
+ case NPOTTextures:
+ case NPOTTextureRepeat:
+ supported = f.version() >= qMakePair(3,0);
+ if (!supported) {
+ supported = ctx->hasExtension(QByteArrayLiteral("GL_OES_texture_npot"));
+ if (!supported)
+ supported = ctx->hasExtension(QByteArrayLiteral("GL_ARB_texture_non_power_of_two"));
+ }
+ default:
+ break;
+ }
+#endif
+
return supported;
}
/*!
Sets the base mipmap level used for all texture lookups with this texture to \a baseLevel.
+ \note This function has no effect on Qt built for OpenGL ES 2.
\sa mipBaseLevel(), setMipMaxLevel(), setMipLevelRange()
*/
void QOpenGLTexture::setMipBaseLevel(int baseLevel)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->textureId);
@@ -2306,6 +2352,10 @@ void QOpenGLTexture::setMipBaseLevel(int baseLevel)
Q_ASSERT(baseLevel <= d->maxLevel);
d->baseLevel = baseLevel;
d->texFuncs->glTextureParameteri(d->textureId, d->target, GL_TEXTURE_BASE_LEVEL, baseLevel);
+#else
+ Q_UNUSED(baseLevel);
+ qWarning("QOpenGLTexture: Mipmap base level is not supported");
+#endif
}
/*!
@@ -2323,10 +2373,12 @@ int QOpenGLTexture::mipBaseLevel() const
/*!
Sets the maximum mipmap level used for all texture lookups with this texture to \a maxLevel.
+ \note This function has no effect on Qt built for OpenGL ES 2.
\sa mipMaxLevel(), setMipBaseLevel(), setMipLevelRange()
*/
void QOpenGLTexture::setMipMaxLevel(int maxLevel)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->textureId);
@@ -2334,6 +2386,10 @@ void QOpenGLTexture::setMipMaxLevel(int maxLevel)
Q_ASSERT(d->baseLevel <= maxLevel);
d->maxLevel = maxLevel;
d->texFuncs->glTextureParameteri(d->textureId, d->target, GL_TEXTURE_MAX_LEVEL, maxLevel);
+#else
+ Q_UNUSED(maxLevel);
+ qWarning("QOpenGLTexture: Mipmap max level is not supported");
+#endif
}
/*!
@@ -2351,10 +2407,12 @@ int QOpenGLTexture::mipMaxLevel() const
Sets the range of mipmap levels that can be used for texture lookups with this texture
to range from \a baseLevel to \a maxLevel.
+ \note This function has no effect on Qt built for OpenGL ES 2.
\sa setMipBaseLevel(), setMipMaxLevel(), mipLevelRange()
*/
void QOpenGLTexture::setMipLevelRange(int baseLevel, int maxLevel)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->textureId);
@@ -2362,12 +2420,17 @@ void QOpenGLTexture::setMipLevelRange(int baseLevel, int maxLevel)
Q_ASSERT(baseLevel <= maxLevel);
d->texFuncs->glTextureParameteri(d->textureId, d->target, GL_TEXTURE_BASE_LEVEL, baseLevel);
d->texFuncs->glTextureParameteri(d->textureId, d->target, GL_TEXTURE_MAX_LEVEL, maxLevel);
+#else
+ Q_UNUSED(baseLevel);
+ Q_UNUSED(maxLevel);
+ qWarning("QOpenGLTexture: Mipmap level range is not supported");
+#endif
}
/*!
Returns the range of mipmap levels that can be used for texture lookups with this texture.
- \sa mipBaseLevel(), mipMaxLevel(), mipLevelRange()
+ \sa mipBaseLevel(), mipMaxLevel()
*/
QPair<int, int> QOpenGLTexture::mipLevelRange() const
{
@@ -2451,11 +2514,12 @@ void QOpenGLTexture::generateMipMaps(int baseLevel, bool resetBaseLevel)
This function maps \a component to the output \a value.
+ \note This function has no effect on Mac and Qt built for OpenGL ES 2.
\sa swizzleMask()
*/
void QOpenGLTexture::setSwizzleMask(SwizzleComponent component, SwizzleValue value)
{
-#if !defined(Q_OS_MAC)
+#if !defined(Q_OS_MAC) && !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2467,9 +2531,9 @@ void QOpenGLTexture::setSwizzleMask(SwizzleComponent component, SwizzleValue val
d->swizzleMask[component - SwizzleRed] = value;
d->texFuncs->glTextureParameteri(d->textureId, d->target, component, value);
#else
- qWarning("Texture swizzling is not supported");
Q_UNUSED(component);
Q_UNUSED(value);
+ qWarning("QOpenGLTexture: Texture swizzling is not supported");
#endif
}
@@ -2479,7 +2543,7 @@ void QOpenGLTexture::setSwizzleMask(SwizzleComponent component, SwizzleValue val
void QOpenGLTexture::setSwizzleMask(SwizzleValue r, SwizzleValue g,
SwizzleValue b, SwizzleValue a)
{
-#if !defined(Q_OS_MAC)
+#if !defined(Q_OS_MAC) && !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2495,11 +2559,11 @@ void QOpenGLTexture::setSwizzleMask(SwizzleValue r, SwizzleValue g,
d->swizzleMask[3] = a;
d->texFuncs->glTextureParameteriv(d->textureId, d->target, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask);
#else
- qWarning("Texture swizzling is not supported");
Q_UNUSED(r);
Q_UNUSED(g);
Q_UNUSED(b);
Q_UNUSED(a);
+ qWarning("QOpenGLTexture: Texture swizzling is not supported");
#endif
}
@@ -2520,11 +2584,12 @@ QOpenGLTexture::SwizzleValue QOpenGLTexture::swizzleMask(SwizzleComponent compon
shader will access the depth component as a single float, as normal. But when
the parameter is set to StencilMode?, the shader will access the stencil component.
+ \note This function has no effect on Mac and Qt built for OpenGL ES 2.
\sa depthStencilMode()
*/
void QOpenGLTexture::setDepthStencilMode(QOpenGLTexture::DepthStencilMode mode)
{
-#if !defined(Q_OS_MAC)
+#if !defined(Q_OS_MAC) && !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2537,7 +2602,7 @@ void QOpenGLTexture::setDepthStencilMode(QOpenGLTexture::DepthStencilMode mode)
d->texFuncs->glTextureParameteri(d->textureId, d->target, GL_DEPTH_STENCIL_TEXTURE_MODE, mode);
#else
Q_UNUSED(mode);
- qWarning("DepthStencil Mode is not supported");
+ qWarning("QOpenGLTexture: DepthStencil Mode is not supported");
#endif
}
@@ -2706,10 +2771,12 @@ QOpenGLTexture::WrapMode QOpenGLTexture::wrapMode(QOpenGLTexture::CoordinateDire
/*!
Sets the border color of the texture to \a color.
+ \note This function has no effect on Mac and Qt built for OpenGL ES 2.
\sa borderColor()
*/
void QOpenGLTexture::setBorderColor(QColor color)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2723,6 +2790,10 @@ void QOpenGLTexture::setBorderColor(QColor color)
for (int i = 0; i < 4; ++i)
d->borderColor.append(QVariant(values[i]));
d->texFuncs->glTextureParameterfv(d->textureId, d->target, GL_TEXTURE_BORDER_COLOR, values);
+#else
+ Q_UNUSED(color);
+ qWarning("QOpenGLTexture: Border color is not supported");
+#endif
}
/*!
@@ -2730,6 +2801,7 @@ void QOpenGLTexture::setBorderColor(QColor color)
*/
void QOpenGLTexture::setBorderColor(float r, float g, float b, float a)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2743,6 +2815,13 @@ void QOpenGLTexture::setBorderColor(float r, float g, float b, float a)
for (int i = 0; i < 4; ++i)
d->borderColor.append(QVariant(values[i]));
d->texFuncs->glTextureParameterfv(d->textureId, d->target, GL_TEXTURE_BORDER_COLOR, values);
+#else
+ Q_UNUSED(r);
+ Q_UNUSED(g);
+ Q_UNUSED(b);
+ Q_UNUSED(a);
+ qWarning("QOpenGLTexture: Border color is not supported");
+#endif
}
/*!
@@ -2750,6 +2829,7 @@ void QOpenGLTexture::setBorderColor(float r, float g, float b, float a)
*/
void QOpenGLTexture::setBorderColor(int r, int g, int b, int a)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2763,6 +2843,13 @@ void QOpenGLTexture::setBorderColor(int r, int g, int b, int a)
for (int i = 0; i < 4; ++i)
d->borderColor.append(QVariant(values[i]));
d->texFuncs->glTextureParameteriv(d->textureId, d->target, GL_TEXTURE_BORDER_COLOR, values);
+#else
+ Q_UNUSED(r);
+ Q_UNUSED(g);
+ Q_UNUSED(b);
+ Q_UNUSED(a);
+ qWarning("QOpenGLTexture: Border color is not supported");
+#endif
// TODO Handle case of using glTextureParameterIiv() based on format
}
@@ -2772,6 +2859,7 @@ void QOpenGLTexture::setBorderColor(int r, int g, int b, int a)
*/
void QOpenGLTexture::setBorderColor(uint r, uint g, uint b, uint a)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2785,6 +2873,13 @@ void QOpenGLTexture::setBorderColor(uint r, uint g, uint b, uint a)
for (int i = 0; i < 4; ++i)
d->borderColor.append(QVariant(values[i]));
d->texFuncs->glTextureParameteriv(d->textureId, d->target, GL_TEXTURE_BORDER_COLOR, values);
+#else
+ Q_UNUSED(r);
+ Q_UNUSED(g);
+ Q_UNUSED(b);
+ Q_UNUSED(a);
+ qWarning("QOpenGLTexture: Border color is not supported");
+#endif
// TODO Handle case of using glTextureParameterIuiv() based on format
}
@@ -2862,10 +2957,12 @@ void QOpenGLTexture::borderColor(unsigned int *border) const
Sets the minimum level of detail to \a value. This limits the selection of highest
resolution mipmap (lowest mipmap level). The default value is -1000.
+ \note This function has no effect on Qt built for OpenGL ES 2.
\sa minimumLevelOfDetail(), setMaximumLevelOfDetail(), setLevelOfDetailRange()
*/
void QOpenGLTexture::setMinimumLevelOfDetail(float value)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2873,6 +2970,10 @@ void QOpenGLTexture::setMinimumLevelOfDetail(float value)
Q_ASSERT(value < d->maxLevelOfDetail);
d->minLevelOfDetail = value;
d->texFuncs->glTextureParameterf(d->textureId, d->target, GL_TEXTURE_MIN_LOD, value);
+#else
+ Q_UNUSED(value);
+ qWarning("QOpenGLTexture: Detail level is not supported");
+#endif
}
/*!
@@ -2890,10 +2991,12 @@ float QOpenGLTexture::minimumLevelOfDetail() const
Sets the maximum level of detail to \a value. This limits the selection of lowest
resolution mipmap (highest mipmap level). The default value is 1000.
+ \note This function has no effect on Qt built for OpenGL ES 2.
\sa maximumLevelOfDetail(), setMinimumLevelOfDetail(), setLevelOfDetailRange()
*/
void QOpenGLTexture::setMaximumLevelOfDetail(float value)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2901,6 +3004,10 @@ void QOpenGLTexture::setMaximumLevelOfDetail(float value)
Q_ASSERT(value > d->minLevelOfDetail);
d->maxLevelOfDetail = value;
d->texFuncs->glTextureParameterf(d->textureId, d->target, GL_TEXTURE_MAX_LOD, value);
+#else
+ Q_UNUSED(value);
+ qWarning("QOpenGLTexture: Detail level is not supported");
+#endif
}
/*!
@@ -2917,10 +3024,12 @@ float QOpenGLTexture::maximumLevelOfDetail() const
/*!
Sets the minimum and maximum level of detail parameters.
+ \note This function has no effect on Qt built for OpenGL ES 2.
\sa levelOfDetailRange(), setMinimumLevelOfDetail(), setMaximumLevelOfDetail()
*/
void QOpenGLTexture::setLevelOfDetailRange(float min, float max)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2930,6 +3039,11 @@ void QOpenGLTexture::setLevelOfDetailRange(float min, float max)
d->maxLevelOfDetail = max;
d->texFuncs->glTextureParameterf(d->textureId, d->target, GL_TEXTURE_MIN_LOD, min);
d->texFuncs->glTextureParameterf(d->textureId, d->target, GL_TEXTURE_MAX_LOD, max);
+#else
+ Q_UNUSED(min);
+ Q_UNUSED(max);
+ qWarning("QOpenGLTexture: Detail level is not supported");
+#endif
}
/*!
@@ -2946,16 +3060,22 @@ QPair<float, float> QOpenGLTexture::levelOfDetailRange() const
/*!
Sets the level of detail bias parameter.
+ \note This function has no effect on Qt built for OpenGL ES 2.
\sa levelofDetailBias()
*/
void QOpenGLTexture::setLevelofDetailBias(float bias)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
Q_ASSERT(d->textureId);
d->levelOfDetailBias = bias;
d->texFuncs->glTextureParameterf(d->textureId, d->target, GL_TEXTURE_LOD_BIAS, bias);
+#else
+ Q_UNUSED(bias);
+ qWarning("QOpenGLTexture: Detail level is not supported");
+#endif
}
/*!
diff --git a/src/gui/opengl/qopengltexture.h b/src/gui/opengl/qopengltexture.h
index e06cf26f60..5c0f8101a6 100644
--- a/src/gui/opengl/qopengltexture.h
+++ b/src/gui/opengl/qopengltexture.h
@@ -96,8 +96,8 @@ public:
DontResetTextureUnit
};
- QOpenGLTexture(Target target);
- QOpenGLTexture(const QImage& image, MipMapGeneration genMipMaps = GenerateMipMaps);
+ explicit QOpenGLTexture(Target target);
+ explicit QOpenGLTexture(const QImage& image, MipMapGeneration genMipMaps = GenerateMipMaps);
~QOpenGLTexture();
// Creation and destruction
@@ -222,7 +222,16 @@ public:
SRGB_Alpha_DXT1 = 0x8C4D, // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT
SRGB_Alpha_DXT3 = 0x8C4E, // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
SRGB_Alpha_DXT5 = 0x8C4F, // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
- SRGB_BP_UNorm = 0x8E8D // GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
+ SRGB_BP_UNorm = 0x8E8D, // GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
+
+ // ES 2 formats
+ DepthFormat = 0x1902, // GL_DEPTH_COMPONENT
+ AlphaFormat = 0x1906, // GL_ALPHA
+ RGBFormat = 0x1907, // GL_RGB
+ RGBAFormat = 0x1908, // GL_RGBA
+ LuminanceFormat = 0x1909, // GL_LUMINANCE
+ LuminanceAlphaFormat = 0x190A
+
};
// This is not used externally yet but is reserved to allow checking of
@@ -296,7 +305,10 @@ public:
RGBA_Integer = 0x8D99, // GL_RGBA_INTEGER
BGRA_Integer = 0x8D9B, // GL_BGRA_INTEGER
Depth = 0x1902, // GL_DEPTH_COMPONENT
- DepthStencil = 0x84F9 // GL_DEPTH_STENCIL
+ DepthStencil = 0x84F9, // GL_DEPTH_STENCIL
+ Alpha = 0x1906, // GL_ALPHA
+ Luminance = 0x1909, // GL_LUMINANCE
+ LuminanceAlpha = 0x190A // GL_LUMINANCE_ALPHA
};
enum PixelType {
@@ -308,6 +320,7 @@ public:
Int32 = 0x1404, // GL_INT
UInt32 = 0x1405, // GL_UNSIGNED_INT
Float16 = 0x140B, // GL_HALF_FLOAT
+ Float16OES = 0x8D61, // GL_HALF_FLOAT_OES
Float32 = 0x1406, // GL_FLOAT
UInt32_RGB9_E5 = 0x8C3E, // GL_UNSIGNED_INT_5_9_9_9_REV
UInt32_RG11B10F = 0x8C3B, // GL_UNSIGNED_INT_10F_11F_11F_REV
diff --git a/src/gui/opengl/qopengltexturecache.cpp b/src/gui/opengl/qopengltexturecache.cpp
index 94b82885ff..4238f63cd8 100644
--- a/src/gui/opengl/qopengltexturecache.cpp
+++ b/src/gui/opengl/qopengltexturecache.cpp
@@ -95,10 +95,9 @@ void QOpenGLTextureCacheWrapper::cleanupTexturesForPixmapData(QPlatformPixmap *p
cleanupTexturesForCacheKey(pmd->cacheKey());
}
-QOpenGLTextureCache::QOpenGLTextureCache(QOpenGLContext *ctx, bool useByteSwapImage)
+QOpenGLTextureCache::QOpenGLTextureCache(QOpenGLContext *ctx)
: QOpenGLSharedResource(ctx->shareGroup())
, m_cache(64 * 1024) // 64 MB cache
- , m_useByteSwapImage(useByteSwapImage)
{
}
@@ -152,38 +151,13 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QImage &i
return id;
}
-static inline void qgl_byteSwapImage(QImage &img)
-{
- const int width = img.width();
- const int height = img.height();
-
- if (QSysInfo::ByteOrder == QSysInfo::LittleEndian)
- {
- for (int i = 0; i < height; ++i) {
- uint *p = (uint *) img.scanLine(i);
- for (int x = 0; x < width; ++x)
- p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00);
- }
- } else {
- for (int i = 0; i < height; ++i) {
- uint *p = (uint *) img.scanLine(i);
- for (int x = 0; x < width; ++x)
- p[x] = (p[x] << 8) | (p[x] >> 24);
- }
- }
-}
-
GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, qint64 key, const QImage &image)
{
GLuint id;
glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_2D, id);
- QImage tx = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
-
- // Performance could be improved by skipping qgl_byteSwapImage().
- if (m_useByteSwapImage)
- qgl_byteSwapImage(tx);
+ QImage tx = image.convertToFormat(QImage::Format_RGBA8888_Premultiplied);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tx.width(), tx.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, const_cast<const QImage &>(tx).bits());
diff --git a/src/gui/opengl/qopengltexturecache_p.h b/src/gui/opengl/qopengltexturecache_p.h
index d4d3f00069..2e82d5f373 100644
--- a/src/gui/opengl/qopengltexturecache_p.h
+++ b/src/gui/opengl/qopengltexturecache_p.h
@@ -78,7 +78,7 @@ class Q_GUI_EXPORT QOpenGLTextureCache : public QOpenGLSharedResource
public:
static QOpenGLTextureCache *cacheForContext(QOpenGLContext *context);
- QOpenGLTextureCache(QOpenGLContext *, bool useByteSwapImage = true);
+ QOpenGLTextureCache(QOpenGLContext *);
~QOpenGLTextureCache();
GLuint bindTexture(QOpenGLContext *context, const QPixmap &pixmap);
@@ -94,7 +94,6 @@ private:
QMutex m_mutex;
QCache<quint64, QOpenGLCachedTexture> m_cache;
- bool m_useByteSwapImage;
};
QT_END_NAMESPACE
diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp
index 506aec0f43..3b62d1d63a 100644
--- a/src/gui/opengl/qopengltextureglyphcache.cpp
+++ b/src/gui/opengl/qopengltextureglyphcache.cpp
@@ -43,6 +43,8 @@
#include "qopenglpaintengine_p.h"
#include "private/qopenglengineshadersource_p.h"
#include "qopenglextensions_p.h"
+#include <qrgb.h>
+#include <private/qdrawhelper_p.h>
QT_BEGIN_NAMESPACE
@@ -301,7 +303,17 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
return;
}
- QImage mask = textureMapForGlyph(glyph, subPixelPosition);
+ QImage mask;
+
+ if (m_current_fontengine->hasInternalCaching()) {
+ QImage *alphaMap = m_current_fontengine->lockedAlphaMapForGlyph(glyph, subPixelPosition, QFontEngine::Format_None);
+ if (!alphaMap || alphaMap->isNull())
+ return;
+ mask = alphaMap->copy();
+ m_current_fontengine->unlockAlphaMapForGlyph();
+ } else {
+ mask = textureMapForGlyph(glyph, subPixelPosition);
+ }
const int maskWidth = mask.width();
const int maskHeight = mask.height();
@@ -316,24 +328,27 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
if (mask.format() == QImage::Format_RGB32
// We need to make the alpha component equal to the average of the RGB values.
// This is needed when drawing sub-pixel antialiased text on translucent targets.
+#if defined(QT_OPENGL_ES_2) || Q_BYTE_ORDER == Q_BIG_ENDIAN
+ || mask.format() == QImage::Format_ARGB32_Premultiplied
+#endif
) {
for (int y = 0; y < maskHeight; ++y) {
- quint32 *src = (quint32 *) mask.scanLine(y);
+ QRgb *src = (QRgb *) mask.scanLine(y);
for (int x = 0; x < maskWidth; ++x) {
- uchar r = src[x] >> 16;
- uchar g = src[x] >> 8;
- uchar b = src[x];
- quint32 avg;
+ int r = qRed(src[x]);
+ int g = qGreen(src[x]);
+ int b = qBlue(src[x]);
+ int avg;
if (mask.format() == QImage::Format_RGB32)
- avg = (quint32(r) + quint32(g) + quint32(b) + 1) / 3; // "+1" for rounding.
+ avg = (r + g + b + 1) / 3; // "+1" for rounding.
else // Format_ARGB_Premultiplied
- avg = src[x] >> 24;
+ avg = qAlpha(src[x]);
-#if defined(QT_OPENGL_ES_2)
+ src[x] = qRgba(r, g, b, avg);
+#if defined(QT_OPENGL_ES_2) || Q_BYTE_ORDER == Q_BIG_ENDIAN
// swizzle the bits to accommodate for the GL_RGBA upload.
- src[x] = (avg << 24) | (quint32(r) << 0) | (quint32(g) << 8) | (quint32(b) << 16);
+ src[x] = ARGB2RGBA(src[x]);
#endif
- src[x] = (src[x] & 0x00ffffff) | (avg << 24);
}
}
}
@@ -341,7 +356,7 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
glBindTexture(GL_TEXTURE_2D, m_textureResource->m_texture);
if (mask.depth() == 32) {
-#if defined(QT_OPENGL_ES_2)
+#if defined(QT_OPENGL_ES_2) || Q_BYTE_ORDER == Q_BIG_ENDIAN
glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_RGBA, GL_UNSIGNED_BYTE, mask.bits());
#else
glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_BGRA, GL_UNSIGNED_BYTE, mask.bits());
diff --git a/src/gui/opengl/qopengltexturehelper.cpp b/src/gui/opengl/qopengltexturehelper.cpp
index e09b84cce6..676c0802de 100644
--- a/src/gui/opengl/qopengltexturehelper.cpp
+++ b/src/gui/opengl/qopengltexturehelper.cpp
@@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE
QOpenGLTextureHelper::QOpenGLTextureHelper(QOpenGLContext *context)
{
// Resolve EXT_direct_state_access entry points if present
+#if !defined(QT_OPENGL_ES_2)
if (context->hasExtension(QByteArrayLiteral("GL_EXT_direct_state_access"))) {
TextureParameteriEXT = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint , GLenum , GLenum , GLint )>(context->getProcAddress(QByteArrayLiteral("glTextureParameteriEXT")));
TextureParameterivEXT = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint , GLenum , GLenum , const GLint *)>(context->getProcAddress(QByteArrayLiteral("glTextureParameterivEXT")));
@@ -96,6 +97,7 @@ QOpenGLTextureHelper::QOpenGLTextureHelper(QOpenGLContext *context)
CompressedTextureImage2D = &QOpenGLTextureHelper::dsa_CompressedTextureImage2D;
CompressedTextureImage3D = &QOpenGLTextureHelper::dsa_CompressedTextureImage3D;
} else {
+#endif
// Use our own DSA emulation
TextureParameteri = &QOpenGLTextureHelper::qt_TextureParameteri;
TextureParameteriv = &QOpenGLTextureHelper::qt_TextureParameteriv;
@@ -117,9 +119,21 @@ QOpenGLTextureHelper::QOpenGLTextureHelper(QOpenGLContext *context)
CompressedTextureImage1D = &QOpenGLTextureHelper::qt_CompressedTextureImage1D;
CompressedTextureImage2D = &QOpenGLTextureHelper::qt_CompressedTextureImage2D;
CompressedTextureImage3D = &QOpenGLTextureHelper::qt_CompressedTextureImage3D;
+#if defined(QT_OPENGL_ES_2)
+ if (context->hasExtension(QByteArrayLiteral("GL_OES_texture_3D"))) {
+ TexImage3D = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*)>(context->getProcAddress(QByteArrayLiteral("glTexImage3DOES")));
+ TexSubImage3D = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*)>(context->getProcAddress(QByteArrayLiteral("glTexSubImage3DOES")));
+ CompressedTexImage3D = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*)>(context->getProcAddress(QByteArrayLiteral("glCompressedTexImage3DOES")));
+ CompressedTexSubImage3D = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*)>(context->getProcAddress(QByteArrayLiteral("glCompressedTexSubImage3DOES")));
+ }
+#endif
+
+#if !defined(QT_OPENGL_ES_2)
}
+#endif
// Some DSA functions are part of NV_texture_multisample instead
+#if !defined(QT_OPENGL_ES_2)
if (context->hasExtension(QByteArrayLiteral("GL_NV_texture_multisample"))) {
TextureImage3DMultisampleNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint , GLenum , GLsizei , GLint , GLsizei , GLsizei , GLsizei , GLboolean )>(context->getProcAddress(QByteArrayLiteral("glTextureImage3DMultisampleNV")));
TextureImage2DMultisampleNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint , GLenum , GLsizei , GLint , GLsizei , GLsizei , GLboolean )>(context->getProcAddress(QByteArrayLiteral("glTextureImage2DMultisampleNV")));
@@ -127,11 +141,14 @@ QOpenGLTextureHelper::QOpenGLTextureHelper(QOpenGLContext *context)
TextureImage3DMultisample = &QOpenGLTextureHelper::dsa_TextureImage3DMultisample;
TextureImage2DMultisample = &QOpenGLTextureHelper::dsa_TextureImage2DMultisample;
} else {
+#endif
TextureImage3DMultisample = &QOpenGLTextureHelper::qt_TextureImage3DMultisample;
TextureImage2DMultisample = &QOpenGLTextureHelper::qt_TextureImage2DMultisample;
+#if !defined(QT_OPENGL_ES_2)
}
+#endif
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN) && !defined(QT_OPENGL_ES_2)
HMODULE handle = GetModuleHandleA("opengl32.dll");
// OpenGL 1.0
diff --git a/src/gui/opengl/qopengltexturehelper_p.h b/src/gui/opengl/qopengltexturehelper_p.h
index e3abaa80af..fa4bd8120a 100644
--- a/src/gui/opengl/qopengltexturehelper_p.h
+++ b/src/gui/opengl/qopengltexturehelper_p.h
@@ -256,6 +256,7 @@ public:
}
private:
+#if !defined(QT_OPENGL_ES_2)
// DSA wrapper (so we can use pointer to member function as switch)
inline void dsa_TextureParameteri(GLuint texture, GLenum target, GLenum pname, GLint param)
{
@@ -403,6 +404,7 @@ private:
{
CompressedTextureImage3DEXT(texture, target, level, internalFormat, width, height, depth, border, imageSize, bits);
}
+#endif
// DSA-like API
@@ -899,6 +901,7 @@ public:
int val = 0;
glGetIntegerv(GL_UNPACK_ALIGNMENT, &val);
options.setAlignment(val);
+#if !defined(QT_OPENGL_ES_2)
glGetIntegerv(GL_UNPACK_SKIP_IMAGES, &val);
options.setSkipImages(val);
glGetIntegerv(GL_UNPACK_SKIP_ROWS, &val);
@@ -914,12 +917,14 @@ public:
options.setLeastSignificantByteFirst(b);
glGetBooleanv(GL_UNPACK_SWAP_BYTES, &b);
options.setSwapBytesEnabled(b);
+#endif
return options;
}
inline void setPixelUploadOptions(const QOpenGLPixelTransferOptions &options)
{
glPixelStorei(GL_UNPACK_ALIGNMENT, options.alignment());
+#if !defined(QT_OPENGL_ES_2)
glPixelStorei(GL_UNPACK_SKIP_IMAGES, options.skipImages());
glPixelStorei(GL_UNPACK_SKIP_ROWS, options.skipRows());
glPixelStorei(GL_UNPACK_SKIP_PIXELS, options.skipPixels());
@@ -927,6 +932,7 @@ public:
glPixelStorei(GL_UNPACK_ROW_LENGTH, options.rowLength());
glPixelStorei(GL_UNPACK_LSB_FIRST, options.isLeastSignificantBitFirst());
glPixelStorei(GL_UNPACK_SWAP_BYTES, options.isSwapBytesEnabled());
+#endif
}
private:
@@ -982,6 +988,7 @@ private:
CompressedTextureImage2DMemberFunc CompressedTextureImage2D;
CompressedTextureImage3DMemberFunc CompressedTextureImage3D;
+#if !defined(QT_OPENGL_ES_2)
// Raw function pointers for core and DSA functions
// EXT_direct_state_access used when DSA is available
@@ -1012,6 +1019,7 @@ private:
// Plus some missing ones that are in the NV_texture_multisample extension instead
void (QOPENGLF_APIENTRYP TextureImage3DMultisampleNV)(GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
void (QOPENGLF_APIENTRYP TextureImage2DMultisampleNV)(GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+#endif
// OpenGL 1.0
void (QOPENGLF_APIENTRYP GetIntegerv)(GLenum pname, GLint *params);