PavelCheckov wrote:
I did extensive research and couldn't find anything, so I just asked in case I missed something.
You misunderstand. I wasn't asking if you had found any, I was asking why you with your multiple years of OS dev experience had not yet moved on to reading documentation instead of looking for someone else who read it, and then transcribed their understanding into an incomplete and possibly incorrect tutorial.
PavelCheckov wrote:
I am more interested in how X actually goes from XDrawLine to an actual line of pixels on screen.
Bresenham's algorithm, but before you get there, you need a host of other things in place. For example, you need an idea of how to represent your clients in memory (on the frame buffer). X11 is a memory-conservative protocol, and allows the server to get by with remembering pretty much only coordinates of each window, but that is already a computationally interesting proposition. If a foreground window is moved, you need to tell the window that was moved where it was moved to, but you also need to tell all the windows behind it to update their contents. So how do you best determine which windows where behind it? Quadtrees may be a good answer here, but require a lot of thought to use well.
You know, thinking about it, Bresenham's algorithm really is the least of it. You have to deal with different data formats. Some applications get by on monochrome, some need full 32-bit framebuffers with alpha-blending. Some applications use ZPixmaps to render stuff, some use XYPixmaps, so you need to translate data unless you want to go crazy. And you have to provide events (and process reactions to those) in a timely manner. Some of those are more complicated than others.
If you are merely interested in rendering stuff, maybe something like XWayland is more up your alley? Wayland provides the frame buffer and events, XWayland merely translates from one to the other. And Wayland doesn't handle rendering, it tells lets the client do it and expects to be told to just update the window contents.