diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-06-09 04:59:16 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-06-09 04:59:16 (GMT) |
commit | edd535defde42cf4b57c6144b6ba8a0607363d5e (patch) | |
tree | d77e95ab7335f3af8feb1b60a440df3b49504386 /src/declarative/opengl | |
parent | a276e872e83e0c2f04a367299580ef787b6efc51 (diff) | |
download | Qt-edd535defde42cf4b57c6144b6ba8a0607363d5e.zip Qt-edd535defde42cf4b57c6144b6ba8a0607363d5e.tar.gz Qt-edd535defde42cf4b57c6144b6ba8a0607363d5e.tar.bz2 |
Fix OpenGL texture access issues
Diffstat (limited to 'src/declarative/opengl')
-rw-r--r-- | src/declarative/opengl/gltexture.cpp | 8 | ||||
-rw-r--r-- | src/declarative/opengl/gltexture.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/declarative/opengl/gltexture.cpp b/src/declarative/opengl/gltexture.cpp index cd9c406..c2a02df 100644 --- a/src/declarative/opengl/gltexture.cpp +++ b/src/declarative/opengl/gltexture.cpp @@ -95,6 +95,7 @@ public: qreal glWidth; qreal glHeight; + QSize glSize; void genTexture(); }; @@ -199,6 +200,7 @@ void GLTexture::setImage(const QImage &img, ImageMode mode) } d->glWidth = 1.; d->glHeight = 1.; + d->glSize = img.size(); } else { // mode == PowerOfTwo @@ -233,6 +235,7 @@ void GLTexture::setImage(const QImage &img, ImageMode mode) d->glWidth = qreal(img.width()) / qreal(max); d->glHeight = qreal(img.height()) / qreal(max); + d->glSize = QSize(max, max); } d->width = img.width(); @@ -273,6 +276,11 @@ qreal GLTexture::glHeight() const return d->glHeight; } +QSize GLTexture::glSize() const +{ + return d->glSize; +} + /*! Sets the \a size of the texture. This will destroy the current contents of the texture. If an image has been assigned, it will need to be reassigned diff --git a/src/declarative/opengl/gltexture.h b/src/declarative/opengl/gltexture.h index d301d8a..c08d68f 100644 --- a/src/declarative/opengl/gltexture.h +++ b/src/declarative/opengl/gltexture.h @@ -77,6 +77,7 @@ public: int height() const; qreal glWidth() const; qreal glHeight() const; + QSize glSize() const; QSize size() const; void setSize(const QSize &); |