diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-06-03 09:07:45 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-06-03 09:07:45 (GMT) |
commit | e91dff94de4851b4b8ac48cadccd516893fe4661 (patch) | |
tree | c3dea50c87c5be7b467ae9ceb08ab618e98cba14 /src/declarative/fx/qfximage.cpp | |
parent | 694b270d78d99e94c8ab7543b7371edbe16ecaab (diff) | |
download | Qt-e91dff94de4851b4b8ac48cadccd516893fe4661.zip Qt-e91dff94de4851b4b8ac48cadccd516893fe4661.tar.gz Qt-e91dff94de4851b4b8ac48cadccd516893fe4661.tar.bz2 |
Use POT textures only
Diffstat (limited to 'src/declarative/fx/qfximage.cpp')
-rw-r--r-- | src/declarative/fx/qfximage.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp index d28cf7d..d3ac38f 100644 --- a/src/declarative/fx/qfximage.cpp +++ b/src/declarative/fx/qfximage.cpp @@ -462,7 +462,7 @@ uint QFxImage::glSimpleItemData(float *vertices, float *texVertices, void QFxImagePrivate::checkDirty() { if (_texDirty && !_pix.isNull()) { - _tex.setImage(_pix.toImage()); + _tex.setImage(_pix.toImage(), GLTexture::PowerOfTwo); _tex.setHorizontalWrap(GLTexture::Repeat); _tex.setVerticalWrap(GLTexture::Repeat); } @@ -548,8 +548,8 @@ void QFxImage::paintGLContents(GLPainter &p) float heightV = height(); float texleft = 0; - float texright = 1; - float textop = 1; + float texright = d->_tex.glWidth(); + float textop = d->_tex.glHeight(); float texbottom = 0; float imgleft = 0; float imgright = widthV; @@ -562,19 +562,19 @@ void QFxImage::paintGLContents(GLPainter &p) const int sgb = d->_scaleGrid->bottom(); if (sgl) { - texleft = float(sgl) / imgWidth; + texleft = d->_tex.glWidth() * float(sgl) / imgWidth; imgleft = sgl; } if (sgr) { - texright = 1. - float(sgr) / imgWidth; + texright = d->_tex.glWidth() - float(sgr) / imgWidth; imgright = widthV - sgr; } if (sgt) { - textop = 1. - float(sgb) / imgHeight; + textop = d->_tex.glHeight() - float(sgb) / imgHeight; imgtop = sgt; } if (sgb) { - texbottom = float(sgt) / imgHeight; + texbottom = d->_tex.glHeight() * float(sgt) / imgHeight; imgbottom = heightV - sgb; } |