$ cat ~/devlog/apollo-bug-fixes.md
Apollo v1.0.1
Recently, while dealing with a recent WallOS update, I cleaned up a lot of the hot path of Apollo.
API Additions
Added two new functions to the API:
uint32_t apollo_pack_color(const framebuffer_info_t* info, apollo_color_t c);
// and
void apollo_fill_span(framebuffer_t* fb, int x, int y, int len, uint32_t packed);
Both of these were added in an effort to clean up the hot path of drawing pixels and text.
The first one offers the most speed up (although it was likely already partially fixed by GCC optimizations).
Several core apollo functions would call apollo_set_pixel() for every single pixel being drawn, which would recalculate the color for every pixel.
This is fine, although a lot of functions draw a lot of pixels without changing colors. apollo_pack_pixel aims to fix this by converting the color to the correct pixel type for the framebuffer, meaning that it doesn't have to recalculate it every single pixel.
The second one is a nice feature that allows drawing a horizontal run of pixels, with automatic checks for clipping out of the framebuffer.
This function has changed how apollo_fill_buffer works, and does noticeably help with speed when clearing large buffers (1440p and up).
Both functions have been combined to improve performance of apollo_set_rect(), which was used for drawing the cursor to the screen in WallOS (and prompted this update in the first place).
Other Notes
- I have some work done in creating a dedicated repo for apollo development. No guarantee on ETA, but it is in the works.