shareable: Add comments

This commit is contained in:
Hajime Hoshi 2019-02-10 14:13:00 +09:00
parent 339155f63d
commit 6f428c584d

View File

@ -296,9 +296,10 @@ func (i *Image) Fill(r, g, b, a uint8) {
rf, gf, bf, af)
is := graphics.QuadIndices()
c := graphics.CompositeModeSourceOver
if a < 0xff {
c = graphics.CompositeModeCopy
c := graphics.CompositeModeCopy
if a == 0xff {
// If the color is opaque, SourceOver is available and this is preferable for optimization.
c = graphics.CompositeModeSourceOver
}
i.DrawImage(emptyImage, vs, is, nil, c, graphics.FilterNearest, graphics.AddressClampToZero)
}