mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-23 17:32:02 +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
|
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 {
|
func (e *encoder) writeImage(w io.Writer, m image.Image, cb int, level int) error {
|
||||||
if e.zw == nil || e.zwLevel != level {
|
if e.zw == nil || e.zwLevel != level {
|
||||||
zw, err := zlib.NewWriterLevel(w, 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)
|
e.pr = make([]uint8, sz)
|
||||||
} else {
|
} else {
|
||||||
e.pr = e.pr[:sz]
|
e.pr = e.pr[:sz]
|
||||||
zeroMemory(e.pr)
|
clear(e.pr)
|
||||||
}
|
}
|
||||||
pr := e.pr
|
pr := e.pr
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user