From 275dd438faa82eaa12429e4fb21ab09cf72ca455 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 16 Jul 2020 01:19:57 +0900 Subject: [PATCH] mipmap: Refactoring: Do not use mipmap when the image is volatile --- internal/mipmap/mipmap.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/mipmap/mipmap.go b/internal/mipmap/mipmap.go index a1dd53330..dd584cd9b 100644 --- a/internal/mipmap/mipmap.go +++ b/internal/mipmap/mipmap.go @@ -298,6 +298,9 @@ func (m *Mipmap) mipmapLevel(geom GeoM, width, height int, filter driver.Filter) if filter == driver.FilterScreen { return 0 } + if m.volatile { + return 0 + } // Use 'negative' mipmap to render edges correctly (#611, #907). // It looks like 128 is the enlargement factor that causes edge missings to pass the test TestImageStretch. @@ -341,9 +344,6 @@ func (m *Mipmap) mipmapLevel(geom GeoM, width, height int, filter driver.Filter) if filter != driver.FilterLinear { return 0 } - if m.volatile { - return 0 - } // This is a separate function for testing. level := MipmapLevelForDownscale(det)