internal/buffered: rename ReplacePixels -> WritePixels

Updates #2236
This commit is contained in:
Hajime Hoshi 2022-08-08 03:29:12 +09:00
parent 8ce84c6596
commit 7061b34222
2 changed files with 4 additions and 4 deletions

View File

@ -118,8 +118,8 @@ func (i *Image) DumpScreenshot(graphicsDriver graphicsdriver.Graphics, name stri
return i.img.DumpScreenshot(graphicsDriver, name, blackbg)
}
// ReplacePixels replaces the pixels at the specified region.
func (i *Image) ReplacePixels(pix []byte, x, y, width, height int) {
// WritePixels replaces the pixels at the specified region.
func (i *Image) WritePixels(pix []byte, x, y, width, height int) {
if l := 4 * width * height; len(pix) != l {
panic(fmt.Sprintf("buffered: len(pix) was %d but must be %d", len(pix), l))
}
@ -128,7 +128,7 @@ func (i *Image) ReplacePixels(pix []byte, x, y, width, height int) {
copied := make([]byte, len(pix))
copy(copied, pix)
if tryAddDelayedCommand(func() {
i.ReplacePixels(copied, x, y, width, height)
i.WritePixels(copied, x, y, width, height)
}) {
return
}

View File

@ -50,7 +50,7 @@ func (m *Mipmap) DumpScreenshot(graphicsDriver graphicsdriver.Graphics, name str
}
func (m *Mipmap) ReplacePixels(pix []byte, x, y, width, height int) {
m.orig.ReplacePixels(pix, x, y, width, height)
m.orig.WritePixels(pix, x, y, width, height)
m.disposeMipmaps()
}