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:
Vlad Zahorodnii 2024-08-20 22:43:34 +03:00
parent 874189f11b
commit f1eb095a0c
3 changed files with 0 additions and 16 deletions

View file

@ -353,17 +353,6 @@ GLenum GLTexture::internalFormat() const
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
{
return d->m_markedDirty;

View file

@ -98,10 +98,6 @@ public:
QImage toImage();
/** @short
* Make the texture fully transparent
*/
void clear();
/**
* @deprecated track modifications to the texture yourself
*/

View file

@ -472,7 +472,6 @@ void SceneOpenGLDecorationRenderer::resizeTexture()
m_texture->setContentTransform(OutputTransform::FlipY);
m_texture->setFilter(GL_LINEAR);
m_texture->setWrapMode(GL_CLAMP_TO_EDGE);
m_texture->clear();
} else {
m_texture.reset();
}