scene: Don't touch texture sampling params in ItemRendererOpenGL

Items must be responsible for choosing texture sampling parameters.
Doing so in the ItemRendererOpenGL breaks the encapsulation.
master
Vlad Zahorodnii 1 year ago
parent 9241252c67
commit f4af66d167

@ -945,7 +945,8 @@ bool GlxPixmapTexturePrivate::create(SurfacePixmapX11 *texture)
glGenTextures(1, &m_texture);
q->setDirty();
q->setFilter(GL_NEAREST);
q->setFilter(GL_LINEAR);
q->setWrapMode(GL_CLAMP_TO_EDGE);
glBindTexture(m_target, m_texture);
glXBindTexImageEXT(m_backend->display(), m_glxPixmap, GLX_FRONT_LEFT_EXT, nullptr);

@ -106,7 +106,7 @@ bool BasicEGLSurfaceTextureWayland::loadDmabufTexture(KWaylandServer::LinuxDmaBu
m_texture->setSize(buffer->size());
m_texture->create();
m_texture->setWrapMode(GL_CLAMP_TO_EDGE);
m_texture->setFilter(GL_NEAREST);
m_texture->setFilter(GL_LINEAR);
m_texture->bind();
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, static_cast<GLeglImageOES>(image));
m_texture->unbind();

@ -353,8 +353,6 @@ void ItemRendererOpenGL::renderItem(const RenderTarget &renderTarget, const Rend
opacity = renderNode.opacity;
}
renderNode.texture->setFilter(GL_LINEAR);
renderNode.texture->setWrapMode(GL_CLAMP_TO_EDGE);
renderNode.texture->bind();
vbo->draw(scissorRegion, GL_TRIANGLES, renderNode.firstVertex,

@ -163,6 +163,8 @@ std::shared_ptr<GLTexture> DecorationShadowTextureCache::getTexture(ShadowTextur
Data d;
d.providers << provider;
d.texture = std::make_shared<GLTexture>(shadow->decorationShadowImage());
d.texture->setFilter(GL_LINEAR);
d.texture->setWrapMode(GL_CLAMP_TO_EDGE);
m_cache.insert(decoShadow.get(), d);
return d.texture;
}
@ -251,6 +253,8 @@ void OpenGLShadowTextureProvider::update()
}
m_texture = std::make_shared<GLTexture>(image);
m_texture->setFilter(GL_LINEAR);
m_texture->setWrapMode(GL_CLAMP_TO_EDGE);
if (m_texture->internalFormat() == GL_R8) {
// Swizzle red to alpha and all other channels to zero
@ -455,6 +459,7 @@ void SceneOpenGLDecorationRenderer::resizeTexture()
if (!size.isEmpty()) {
m_texture.reset(new GLTexture(GL_RGBA8, size.width(), size.height()));
m_texture->setContentTransform(TextureTransform::MirrorY);
m_texture->setFilter(GL_LINEAR);
m_texture->setWrapMode(GL_CLAMP_TO_EDGE);
m_texture->clear();
} else {

Loading…
Cancel
Save