buffered: Fix delayed DrawImage() (#1050)

This commit is contained in:
hiroebe 2020-01-10 23:58:22 +09:00 committed by Hajime Hoshi
parent ad00414a2a
commit 27404b7ae3

View File

@ -222,6 +222,8 @@ func (i *Image) DrawImage(src *Image, bounds image.Rectangle, a, b, c, d, tx, ty
delayedCommandsM.Lock()
if needsToDelayCommands {
delayedCommands = append(delayedCommands, func() {
src.resolvePendingPixels(true)
i.resolvePendingPixels(false)
i.img.DrawImage(src.img, bounds, g, colorm, mode, filter)
})
delayedCommandsM.Unlock()
@ -242,6 +244,8 @@ func (i *Image) DrawTriangles(src *Image, vertices []float32, indices []uint16,
delayedCommandsM.Lock()
if needsToDelayCommands {
delayedCommands = append(delayedCommands, func() {
src.resolvePendingPixels(true)
i.resolvePendingPixels(false)
i.img.DrawTriangles(src.img, vertices, indices, colorm, mode, filter, address)
})
delayedCommandsM.Unlock()