Open
Description
The TextRenderer
needs to check sometimes whether draw operations are out-of-bounds. The algorithm can be sped up when introducing a so called "protection margin" for TextSurface
. The protection margin is just an over-allocation of the text surface, which would increase the size by a fixed value, so the real size gets (width + protection_margin * 2, height + protection_margin * 2)
. The TextSurface
would operate normally like before, but out-of-bound accesses are harmless when not too far away from the presented (width, height)
of TextSurface
.