| > Also, as you can easily see, your code has 2× overdraw, visiting the whole framebuffer roughly from beginning to end twice: Yes I did it for simplicity, as I wanted to get the estimate of how fast or slow can be CPU rendering. Probably I could clear the buffer by small tiles right before rendering text, so that cleared part stays in L1 cache and can be blended faster. I glanced through your code but it also seems to copy the data from a glyph cache into the buffer, it just has more optimizations to skip some parts. > I've heard there are ways to allocate your memory buffers such that you get zero-copy scanout in the fullscreen case (GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR or DRM) but I haven't tried Wayland. Maybe, but a maximized window usually leaves some space for task bars, status bars. Also, on a large monitor you typically do not open windows fullscreen. So the rendering goes through a window buffer in shared memory (on Wayland, and X applications often use SHM extension to achieve the same effect). > In particular, my example, "to scroll the contents of a browser window but not the browser chrome," can be handled by redrawing the browser chrome in a different position over part of the scrolled page. I'm not sure how you would design the graphics API to make this simple, but you can clearly do it. Yes it seems that nobody does it these days, so the best you can do is to have two buffers (for the toolbars and for the content) and ask the display compositor to combine them. Which it will do through a memcpy, but if the buffers are in VRAM, the GPU will do the copying. However, while Wayland supports compositing window from subsurfaces, it doesn't support "scrolling" of a surface (displaying the content of a buffer with an offset and wrapping), so you need to redraw the whole buffer on scrolling. |