Remove SceneOpenGL::Texture::load(QPixmap)

Fold it into the constructor, since that's the only place
where it's called.
This commit is contained in:
Fredrik Höglund 2014-04-13 20:42:47 +02:00
parent 49c8827345
commit 210df22b17
2 changed files with 1 additions and 10 deletions

View file

@ -757,7 +757,7 @@ SceneOpenGL::Texture::Texture(OpenGLBackend *backend)
SceneOpenGL::Texture::Texture(OpenGLBackend *backend, const QPixmap &pix, GLenum target) SceneOpenGL::Texture::Texture(OpenGLBackend *backend, const QPixmap &pix, GLenum target)
: GLTexture(*backend->createBackendTexture(this)) : GLTexture(*backend->createBackendTexture(this))
{ {
load(pix, target); GLTexture::load(pix.toImage(), target);
} }
SceneOpenGL::Texture::~Texture() SceneOpenGL::Texture::~Texture()
@ -787,14 +787,6 @@ bool SceneOpenGL::Texture::load(xcb_pixmap_t pix, const QSize &size, int depth)
return d->loadTexture(pix, size, depth); return d->loadTexture(pix, size, depth);
} }
bool SceneOpenGL::Texture::load(const QPixmap& pixmap, GLenum target)
{
if (pixmap.isNull())
return false;
return GLTexture::load(pixmap.toImage(), target);
}
void SceneOpenGL::Texture::findTarget() void SceneOpenGL::Texture::findTarget()
{ {
Q_D(Texture); Q_D(Texture);

View file

@ -166,7 +166,6 @@ public:
Texture & operator = (const Texture& tex); Texture & operator = (const Texture& tex);
using GLTexture::load; using GLTexture::load;
virtual bool load(const QPixmap& pixmap, GLenum target = GL_TEXTURE_2D);
virtual void discard(); virtual void discard();
bool update(const QRegion &damage); bool update(const QRegion &damage);