Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Make sure that frame is shown correctly in bilinear mode after playback

Dmitry Kazakov5a6b5c34bd5f
diff --git a/libs/ui/opengl/kis_texture_tile.cpp b/libs/ui/opengl/kis_texture_tile.cpp
index 6330690cca..21612cce3e 100644
--- a/libs/ui/opengl/kis_texture_tile.cpp
+++ b/libs/ui/opengl/kis_texture_tile.cpp
@@ -357,7 +357,19 @@ void KisTextureTile::update(const KisTextureTileUpdateInfo &updateInfo, bool blo
restoreTextureParameters();
if (!patchLevelOfDetail) {
- setNeedsMipmapRegeneration();
+ if (m_mipmapHasBeenAllocated &&
+ (m_filter == KisOpenGL::BilinearFilterMode ||
+ m_filter == KisOpenGL::NearestFilterMode)) {
+ /**
+ * When in a mode that doesn't use mipmaps we should
+ * just switch back onto lod0 plane instead of requesting
+ * full mipmap regeneration.
+ */
+
+ setPreparedLodPlane(0);
+ } else {
+ setNeedsMipmapRegeneration();
+ }
} else {
setPreparedLodPlane(patchLevelOfDetail);
}