|
|
|
|
|
by ben-schaaf
9 days ago
|
|
Pegging the CPU while scrolling - a common action that takes a full rerender - is not good enough in this day and age. Your best case scenario still doesn't achieve the minimum for a 4k120hz display. Take into account text with subpixel-antialiasing, and that resolutions scale to ok now and you'll quickly find CPU rendering unusably slow. Shader compilation basically doesn't matter. The number of shaders needed for a GUI toolkit is tiny, and none are particularly complex. In my experience it doesn't appreciably add to the startup time. I do agree there should still be CPU rendering for when the GPU doesn't work. It's a particularly useful feature for old or virtualised hardware. |
|
For example, if you are scrolling a PDF you could theoretically "scroll" (change start y offset) of the window buffer, render a newly visible stripe (those 6px) and re-render the toolbar 6px lower which otherwise would scroll with the window.
It seems nobody can do this nowadays, so another option is to use two layers - a document and a toolbar and offload the compositing to window compositor which might as well use GPU for that. So you have one buffer with a toolbar (never changes), and another buffer with a document, and when scrolling, you only draw the changed part and instruct the compositor to draw the document with an offset.