shareable: Use CompositeModeSourceOver when possible at Fill

This commit is contained in:
Hajime Hoshi 2019-02-10 14:08:59 +09:00
parent 1150fc69d0
commit 339155f63d

View File

@ -296,7 +296,11 @@ func (i *Image) Fill(r, g, b, a uint8) {
rf, gf, bf, af) rf, gf, bf, af)
is := graphics.QuadIndices() is := graphics.QuadIndices()
i.DrawImage(emptyImage, vs, is, nil, graphics.CompositeModeCopy, graphics.FilterNearest, graphics.AddressClampToZero) c := graphics.CompositeModeSourceOver
if a < 0xff {
c = graphics.CompositeModeCopy
}
i.DrawImage(emptyImage, vs, is, nil, c, graphics.FilterNearest, graphics.AddressClampToZero)
} }
func (i *Image) ReplacePixels(p []byte) { func (i *Image) ReplacePixels(p []byte) {