graphics: Remove unnecessary copying pixels

Updates #983
This commit is contained in:
Hajime Hoshi 2019-11-16 01:38:32 +09:00
parent f1091910bd
commit 77a8ece691

View File

@ -454,9 +454,7 @@ func (i *Image) ReplacePixels(p []byte) error {
panic(fmt.Sprintf("ebiten: len(p) was %d but must be %d", len(p), l)) panic(fmt.Sprintf("ebiten: len(p) was %d but must be %d", len(p), l))
} }
px := make([]byte, len(p)) i.mipmap.replacePixels(p)
copy(px, p)
i.mipmap.replacePixels(px)
return nil return nil
} }