diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-11-26 15:18:09 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-11-29 16:17:54 +0000 |
commit | 4e4e178d3b7adc7aa0b812838b3fb06090ab1499 (patch) | |
tree | d511cb948d5640e4475294b126e503541203eaf9 | |
parent | f7110be2c88596814d1210d8fe1af9c501f9555e (diff) |
Enable bilinear filtering for software textures
Currently these will always have a filter value of 0 from Chromium.
However fixing it exposes another bug that looks worse, so depend on
that being fixed in 5.12.1.
Change-Id: I3481a8cc5fa9fb98ae597905d22973ec411a1134
Fixes: QTBUG-71322
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
-rw-r--r-- | src/core/delegated_frame_node.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp index 84fde7ca2..3755759a1 100644 --- a/src/core/delegated_frame_node.cpp +++ b/src/core/delegated_frame_node.cpp @@ -101,6 +101,10 @@ #define GL_TEXTURE_RECTANGLE 0x84F5 #endif +#ifndef GL_NEAREST +#define GL_NEAREST 0x2600 +#endif + #ifndef GL_LINEAR #define GL_LINEAR 0x2601 #endif @@ -642,7 +646,18 @@ QSharedPointer<QSGTexture> ResourceHolder::initTexture(bool quadNeedsBlending, R Q_UNREACHABLE(); #endif } - texture->setFiltering(m_resource.filter == GL_LINEAR ? QSGTexture::Linear : QSGTexture::Nearest); + if (m_resource.filter == GL_NEAREST) + texture->setFiltering(QSGTexture::Nearest); + else if (m_resource.filter == GL_LINEAR) + texture->setFiltering(QSGTexture::Linear); + else { + // Depends on qtdeclarative fix, see QTBUG-71322 +#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 1) + texture->setFiltering(QSGTexture::Linear); +#else + texture->setFiltering(QSGTexture::Nearest); +#endif + } m_texture = texture; } // All quads using a resource should request the same blending state. |