opengl: Drop GLTexture::clear()
It's used only by the decoration renderer, but even it doesn't need it because the atlas parts are padded. From the API point of view, it's worth looking for alternative solutions, like integrating the render target clear step in the render passes. And texture uploading code usually doesn't need to clear the texture because it is going to overwrite its contents anyway.
This commit is contained in:
parent
874189f11b
commit
f1eb095a0c
3 changed files with 0 additions and 16 deletions
|
@ -353,17 +353,6 @@ GLenum GLTexture::internalFormat() const
|
||||||
return d->m_internalFormat;
|
return d->m_internalFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLTexture::clear()
|
|
||||||
{
|
|
||||||
Q_ASSERT(d->m_owning);
|
|
||||||
GLFramebuffer fbo(this);
|
|
||||||
GLFramebuffer::pushFramebuffer(&fbo);
|
|
||||||
glClearColor(0, 0, 0, 0);
|
|
||||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, d->m_texture, 0);
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
|
||||||
GLFramebuffer::popFramebuffer();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GLTexture::isDirty() const
|
bool GLTexture::isDirty() const
|
||||||
{
|
{
|
||||||
return d->m_markedDirty;
|
return d->m_markedDirty;
|
||||||
|
|
|
@ -98,10 +98,6 @@ public:
|
||||||
|
|
||||||
QImage toImage();
|
QImage toImage();
|
||||||
|
|
||||||
/** @short
|
|
||||||
* Make the texture fully transparent
|
|
||||||
*/
|
|
||||||
void clear();
|
|
||||||
/**
|
/**
|
||||||
* @deprecated track modifications to the texture yourself
|
* @deprecated track modifications to the texture yourself
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -472,7 +472,6 @@ void SceneOpenGLDecorationRenderer::resizeTexture()
|
||||||
m_texture->setContentTransform(OutputTransform::FlipY);
|
m_texture->setContentTransform(OutputTransform::FlipY);
|
||||||
m_texture->setFilter(GL_LINEAR);
|
m_texture->setFilter(GL_LINEAR);
|
||||||
m_texture->setWrapMode(GL_CLAMP_TO_EDGE);
|
m_texture->setWrapMode(GL_CLAMP_TO_EDGE);
|
||||||
m_texture->clear();
|
|
||||||
} else {
|
} else {
|
||||||
m_texture.reset();
|
m_texture.reset();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue