Remove GLTexture::load(QPixmap) and load(QString)
These methods are only called from the GLTexture constructors, so inline them there.
This commit is contained in:
parent
fa52af4765
commit
9c7720abca
2 changed files with 2 additions and 18 deletions
|
@ -73,13 +73,13 @@ GLTexture::GLTexture(const QImage& image, GLenum target)
|
|||
GLTexture::GLTexture(const QPixmap& pixmap, GLenum target)
|
||||
: d_ptr(new GLTexturePrivate())
|
||||
{
|
||||
load(pixmap, target);
|
||||
load(pixmap.toImage(), target);
|
||||
}
|
||||
|
||||
GLTexture::GLTexture(const QString& fileName)
|
||||
: d_ptr(new GLTexturePrivate())
|
||||
{
|
||||
load(fileName);
|
||||
load(QImage(fileName));
|
||||
}
|
||||
|
||||
GLTexture::GLTexture(int width, int height)
|
||||
|
@ -305,20 +305,6 @@ void GLTexture::update(const QImage &image, const QPoint &offset, const QRect &s
|
|||
}
|
||||
}
|
||||
|
||||
bool GLTexture::load(const QPixmap& pixmap, GLenum target)
|
||||
{
|
||||
if (pixmap.isNull())
|
||||
return false;
|
||||
return load(pixmap.toImage(), target);
|
||||
}
|
||||
|
||||
bool GLTexture::load(const QString& fileName)
|
||||
{
|
||||
if (fileName.isEmpty())
|
||||
return false;
|
||||
return load(QImage(fileName));
|
||||
}
|
||||
|
||||
void GLTexture::discard()
|
||||
{
|
||||
d_ptr = new GLTexturePrivate();
|
||||
|
|
|
@ -83,8 +83,6 @@ public:
|
|||
QMatrix4x4 matrix(TextureCoordinateType type) const;
|
||||
|
||||
virtual bool load(const QImage& image, GLenum target = GL_TEXTURE_2D);
|
||||
virtual bool load(const QPixmap& pixmap, GLenum target = GL_TEXTURE_2D);
|
||||
virtual bool load(const QString& fileName);
|
||||
void update(const QImage& image, const QPoint &offset = QPoint(0, 0), const QRect &src = QRect());
|
||||
virtual void discard();
|
||||
void bind();
|
||||
|
|
Loading…
Reference in a new issue