graphics: Bug fix: Pixels should be copied to store it as a command

This commit is contained in:
Hajime Hoshi 2016-08-17 22:10:29 +09:00
parent 612d3b07b0
commit 7b32d7a206

View File

@ -116,9 +116,11 @@ func (i *Image) Pixels(context *opengl.Context) ([]uint8, error) {
}
func (i *Image) ReplacePixels(p []uint8) error {
pixels := make([]uint8, len(p))
copy(pixels, p)
c := &replacePixelsCommand{
dst: i,
pixels: p,
pixels: pixels,
}
theCommandQueue.Enqueue(c)
return nil