From 71e3ce7f0b671ac8bb6607d18d4fa16c6c81f737 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 26 Mar 2015 16:39:13 +0100 Subject: The default wrap mode is REPEAT As per spec, both for OpenGL and OpenGL ES. No wrap mode is applied unless setWrapMode() is called so the default values should be initialized to match OpenGL's default. Correct the copy-paste mistake in the warning messages. Change-Id: I094cc511dc7de4a214da61faadb1fc362270b2d4 Reviewed-by: Giuseppe D'Angelo --- src/gui/opengl/qopengltexture.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/gui/opengl/qopengltexture.cpp') diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp index 9bc9926b70..baa702a982 100644 --- a/src/gui/opengl/qopengltexture.cpp +++ b/src/gui/opengl/qopengltexture.cpp @@ -120,7 +120,8 @@ QOpenGLTexturePrivate::QOpenGLTexturePrivate(QOpenGLTexture::Target textureTarge swizzleMask[2] = QOpenGLTexture::BlueValue; swizzleMask[3] = QOpenGLTexture::AlphaValue; - wrapModes[0] = wrapModes[1] = wrapModes[2] = QOpenGLTexture::ClampToEdge; + wrapModes[0] = wrapModes[1] = wrapModes[2] = target == QOpenGLTexture::TargetRectangle + ? QOpenGLTexture::ClampToEdge : QOpenGLTexture::Repeat; } QOpenGLTexturePrivate::~QOpenGLTexturePrivate() @@ -215,7 +216,8 @@ void QOpenGLTexturePrivate::destroy() swizzleMask[2] = QOpenGLTexture::BlueValue; swizzleMask[3] = QOpenGLTexture::AlphaValue; - wrapModes[0] = wrapModes[1] = wrapModes[2] = QOpenGLTexture::ClampToEdge; + wrapModes[0] = wrapModes[1] = wrapModes[2] = target == QOpenGLTexture::TargetRectangle + ? QOpenGLTexture::ClampToEdge : QOpenGLTexture::Repeat; } void QOpenGLTexturePrivate::bind() @@ -1393,7 +1395,7 @@ QOpenGLTexture::WrapMode QOpenGLTexturePrivate::wrapMode(QOpenGLTexture::Coordin case QOpenGLTexture::DirectionT: case QOpenGLTexture::DirectionR: - qWarning("QOpenGLTexture::setWrapMode() direction not valid for this texture target"); + qWarning("QOpenGLTexture::wrapMode() direction not valid for this texture target"); return QOpenGLTexture::Repeat; } break; @@ -1413,7 +1415,7 @@ QOpenGLTexture::WrapMode QOpenGLTexturePrivate::wrapMode(QOpenGLTexture::Coordin return wrapModes[1]; case QOpenGLTexture::DirectionR: - qWarning("QOpenGLTexture::setWrapMode() direction not valid for this texture target"); + qWarning("QOpenGLTexture::wrapMode() direction not valid for this texture target"); return QOpenGLTexture::Repeat; } break; -- cgit v1.2.3