summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-03-26 16:39:13 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-04-16 16:46:35 +0000
commit71e3ce7f0b671ac8bb6607d18d4fa16c6c81f737 (patch)
tree241dccee4b973754521b83665ce1372c235a7c35 /src/gui
parentb7d75277208cdbd63c4483fb89fc04798939c651 (diff)
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 <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/opengl/qopengltexture.cpp10
1 files changed, 6 insertions, 4 deletions
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;