mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-13 04:22:05 +01:00
shareable: Add comments
This commit is contained in:
parent
339155f63d
commit
6f428c584d
@ -296,9 +296,10 @@ func (i *Image) Fill(r, g, b, a uint8) {
|
|||||||
rf, gf, bf, af)
|
rf, gf, bf, af)
|
||||||
is := graphics.QuadIndices()
|
is := graphics.QuadIndices()
|
||||||
|
|
||||||
c := graphics.CompositeModeSourceOver
|
c := graphics.CompositeModeCopy
|
||||||
if a < 0xff {
|
if a == 0xff {
|
||||||
c = graphics.CompositeModeCopy
|
// 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)
|
i.DrawImage(emptyImage, vs, is, nil, c, graphics.FilterNearest, graphics.AddressClampToZero)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user