diff options
author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-02-24 16:09:25 +0300 |
---|---|---|
committer | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-03-02 19:23:44 +0000 |
commit | 3ec093a758ca0250e402176c1a7ee1f53324975a (patch) | |
tree | bab072cb2d6a684c246b37fbb4a8f9824a0f6a91 /src/gui/opengl/qopengltexture.cpp | |
parent | 752e85947c08c687c3e297bbd0e00a1a4d677cfb (diff) |
QOpenGLTexture: de-duplicate setBorderColor() code
Change-Id: I6864e227fceb133903979ac8f7a7434fc3e280bf
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/gui/opengl/qopengltexture.cpp')
-rw-r--r-- | src/gui/opengl/qopengltexture.cpp | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp index 23ae5febc0..1db61b7ca1 100644 --- a/src/gui/opengl/qopengltexture.cpp +++ b/src/gui/opengl/qopengltexture.cpp @@ -4110,27 +4110,8 @@ QOpenGLTexture::WrapMode QOpenGLTexture::wrapMode(QOpenGLTexture::CoordinateDire */ void QOpenGLTexture::setBorderColor(QColor color) { -#if !defined(QT_OPENGL_ES_2) - if (!QOpenGLContext::currentContext()->isOpenGLES()) { - Q_D(QOpenGLTexture); - d->create(); - Q_ASSERT(d->texFuncs); - Q_ASSERT(d->textureId); - float values[4]; - values[0] = color.redF(); - values[1] = color.greenF(); - values[2] = color.blueF(); - values[3] = color.alphaF(); - d->borderColor.clear(); - for (int i = 0; i < 4; ++i) - d->borderColor.append(QVariant(values[i])); - d->texFuncs->glTextureParameterfv(d->textureId, d->target, d->bindingTarget, GL_TEXTURE_BORDER_COLOR, values); - return; - } -#else - Q_UNUSED(color); -#endif - qWarning("QOpenGLTexture: Border color is not supported"); + setBorderColor(static_cast<float>(color.redF()), static_cast<float>(color.greenF()), + static_cast<float>(color.blueF()), static_cast<float>(color.alphaF())); } /*! |