mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-13 22:47:26 +01:00
internal/png: go generate
This commit is contained in:
parent
a499a976f7
commit
f0d4147ed5
@ -297,12 +297,6 @@ func filter(cr *[nFilter][]byte, pr []byte, bpp int) int {
|
||||
return filter
|
||||
}
|
||||
|
||||
func zeroMemory(v []uint8) {
|
||||
for i := range v {
|
||||
v[i] = 0
|
||||
}
|
||||
}
|
||||
|
||||
func (e *encoder) writeImage(w io.Writer, m image.Image, cb int, level int) error {
|
||||
if e.zw == nil || e.zwLevel != level {
|
||||
zw, err := zlib.NewWriterLevel(w, level)
|
||||
@ -361,7 +355,7 @@ func (e *encoder) writeImage(w io.Writer, m image.Image, cb int, level int) erro
|
||||
e.pr = make([]uint8, sz)
|
||||
} else {
|
||||
e.pr = e.pr[:sz]
|
||||
zeroMemory(e.pr)
|
||||
clear(e.pr)
|
||||
}
|
||||
pr := e.pr
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user