Closed Roger-random closed 3 years ago
Implemented in 0a1abcc1bc13aa6d3955c0a3850d5bc7f57e7f4a
drawFastVLine()
drawFastHLine()
fillRect()
In addition to previously implemented fillScreen()
Example to demonstrate performance limits of these APIs in 291ac9831d87801b30f078e557d9a112af8714fc
An implementation of
Adafruit_GFX
is absolutely required to implementdrawPixel()
by overriding that pure virtual method. Everything beyond that point is optional, as they all offer fallback implementations that eventually end up atdrawPixel()
.For v1.0.0, the only other override was
fillScreen()
so there are a few promising venues for performance enhancements. Top of the list isdrawFastHLine()
.ESP_8_BIT
(from which this project was derived) set up the frame buffer as an array of pointers to horizontal lines, sodrawFastHLine()
can be optimized into a singlememset()
call.In contrast,
drawFastVLine()
is less likely to offer significant improvements, because we have to step through the line array anyway, but it might be worth a shot.Once
drawFastHLine()
has been implemented, it should be tested to verify it is indeed faster and not counterintuitively slower for some surprising reason. (Requires #4 ) Once confirmed, it might be worth overriding a few other methods because their default implementation calls intodrawFastVLine()
instead ofdrawFastHLine()
. (Example:fillRect()
) Switching them todrawFastHLine()
should be faster.