mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
text/v2: performance optimization by using image.RGBA
Apparently, image.RGBA doesn't use the slow path at draw.Draw, which is called from a rasterizer's Draw. Updates #2454
This commit is contained in:
parent
4755da6a08
commit
ca8a2896b4
@ -116,7 +116,7 @@ func segmentsToImage(segs []api.Segment, subpixelOffset fixed.Point26_6, glyphBo
|
||||
}
|
||||
}
|
||||
|
||||
dst := image.NewAlpha(image.Rect(0, 0, w, h))
|
||||
dst := image.NewRGBA(image.Rect(0, 0, w, h))
|
||||
rast.Draw(dst, dst.Bounds(), image.Opaque, image.Point{})
|
||||
return ebiten.NewImageFromImage(dst)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user