graphicsdriver/opengl: Refactoring

This commit is contained in:
Hajime Hoshi 2019-02-17 14:30:32 +09:00
parent d927241223
commit 3d8a45a770

View File

@ -322,10 +322,9 @@ func (d *Driver) useProgram(mode graphics.CompositeMode, colorM *affine.ColorM,
}
}
sw := graphics.InternalImageSize(srcW)
sh := graphics.InternalImageSize(srcH)
if filter != graphics.FilterNearest {
sw := graphics.InternalImageSize(srcW)
sh := graphics.InternalImageSize(srcH)
if d.state.lastSourceWidth != sw || d.state.lastSourceHeight != sh {
d.context.uniformFloats(program, "source_size", []float32{float32(sw), float32(sh)})
d.state.lastSourceWidth = sw