From 9c7720abca5a7a830f38cf517cf273c852b9c2b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Wed, 26 Nov 2014 21:30:22 +0100 Subject: [PATCH] Remove GLTexture::load(QPixmap) and load(QString) These methods are only called from the GLTexture constructors, so inline them there. --- libkwineffects/kwingltexture.cpp | 18 ++---------------- libkwineffects/kwingltexture.h | 2 -- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/libkwineffects/kwingltexture.cpp b/libkwineffects/kwingltexture.cpp index 6fb40c1000..f34d9db144 100644 --- a/libkwineffects/kwingltexture.cpp +++ b/libkwineffects/kwingltexture.cpp @@ -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(); diff --git a/libkwineffects/kwingltexture.h b/libkwineffects/kwingltexture.h index 85db24c187..02f1c00bdb 100644 --- a/libkwineffects/kwingltexture.h +++ b/libkwineffects/kwingltexture.h @@ -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();