mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
internal/restorable: use clearImage to avoid allocations
This commit is contained in:
parent
e768e8ad40
commit
cc8cf688f4
@ -130,7 +130,7 @@ func (pr *pixelsRecords) apply(img *graphicscommand.Image) {
|
|||||||
if r.pix != nil {
|
if r.pix != nil {
|
||||||
img.WritePixels(r.pix, r.rect)
|
img.WritePixels(r.pix, r.rect)
|
||||||
} else {
|
} else {
|
||||||
img.WritePixels(make([]byte, 4*r.rect.Dx()*r.rect.Dy()), r.rect)
|
clearImage(img, r.rect)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user