The blending rate of colors in a square vertices should be calculated
by the lower-right point, not the upper-left point.
mix(a, b, rate) function calculates (1-rate)*a + rate*b, so a should
be weighted if rate is close to 0, and b should be weighted if rate
is close to 1. The current implementation was opposite.
Rendering results don't seem to be changed so much actually, but the
current implementation doesn't make sense.
This seems no longer needed with the pixel mode.
This was confirmed by this test:
```
go run . -run=TestImageLinearFilterGlitch2
```
The same change didn't work at b5ca404c42
but worked at 49582519c1, which
introduced the pixel mode.
Updates #1212
This change adds a new compiler directive 'kage:unit' to Kage. This
takes one of these two values: 'pixel' and 'texel'. The default value
is 'texel'.
With the pixel-unit mode, all the built-in functions treats pixels
instead of texels, and the texCoord argument of Fragment is in pixels.
This simplifies shader programs as programs no longer have the notion
of texels.
With the texel-unit mode, the behavior is the same as the current
behavior.
Closes#1431
This replaces the built-in shaders with Kage shadres. This is a
refactoring and doesn't degrade performance:
```
go test -bench=^BenchmarkColorMScale$ -run=^$ . -count=5
```
```
name old time/op new time/op delta
ColorMScale-8 978ns ±15% 1184ns ±46% ~ (p=0.413 n=4+5)
```
A follow-up change to remove the built-in shaders is needed.
Closes#2364