mipmap: Refactoring: Do not use mipmap when the image is volatile

This commit is contained in:
Hajime Hoshi 2020-07-16 01:19:57 +09:00
parent 04b26adf3d
commit 275dd438fa

View File

@ -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)