mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
ebiten: Improve TestImageColorMCopy to test copying actually works
This commit is contained in:
parent
198621404f
commit
5c4740c294
@ -2181,14 +2181,14 @@ func TestImageColorMCopy(t *testing.T) {
|
|||||||
|
|
||||||
for k := 0; k < 256; k++ {
|
for k := 0; k < 256; k++ {
|
||||||
op := &DrawImageOptions{}
|
op := &DrawImageOptions{}
|
||||||
op.ColorM.Translate(float64(k)/0xff, 1, 1, 1)
|
op.ColorM.Translate(1, 1, 1, float64(k)/0xff)
|
||||||
op.CompositeMode = CompositeModeCopy
|
op.CompositeMode = CompositeModeCopy
|
||||||
dst.DrawImage(src, op)
|
dst.DrawImage(src, op)
|
||||||
|
|
||||||
for j := 0; j < h; j++ {
|
for j := 0; j < h; j++ {
|
||||||
for i := 0; i < w; i++ {
|
for i := 0; i < w; i++ {
|
||||||
got := dst.At(i, j).(color.RGBA)
|
got := dst.At(i, j).(color.RGBA)
|
||||||
want := color.RGBA{byte(k), 0xff, 0xff, 0xff}
|
want := color.RGBA{byte(k), byte(k), byte(k), byte(k)}
|
||||||
if !sameColors(got, want, 1) {
|
if !sameColors(got, want, 1) {
|
||||||
t.Fatalf("dst.At(%d, %d), k: %d: got %v, want %v", i, j, k, got, want)
|
t.Fatalf("dst.At(%d, %d), k: %d: got %v, want %v", i, j, k, got, want)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user