Closed stevesims closed 2 months ago
similar optimisations may be possible for graphics calls
phase 1 of this was implemented in 2.8.0, which gathers characters up to be drawn
text printing in the underlying vdp-gl essentially is all one character at a time. this applies when using canvas->drawText
- that just gets turned into multiple "draw glyph" primitives in the drawing queue, which is essentially identical to our current text drawing
there is therefore essentially no benefit to any further text printing optimisations at the agon-vdp layer.
closing this issue, as what practical optimisations can be done now have been
Currently all test output on the VDP is done by plotting one character at a time. This involves several canvas calls to ensure that the current state of the canvas is correct for text plotting, together with a
canvas->drawChar
callThis results in quite a lot of command primitives added to the internal vdp-gl drawing command queue, many of which could likely be skipped.
An obvious optimisation would be to detect sequential
plotCharacter
calls, thus allowing the calls that set up the canvas for text plotting to be skipped when they are unnecessary.A more sophisticated optimisation could be to collect characters to be plotted into strings, and to use
canvas->drawText
to render out those strings in one go. This would be more complex to achieve, especially considering text can be sent non-terminated to the VDP for printing without subsequent VDU commands being sent. This likely means that such a printing method may involve a (rapid) timeout detecting "no more input".