bitmaps or no?

James K. Lowden jklowden at schemamania.org
Wed Dec 2 00:36:20 UTC 2020


I have a basic how-does-one question about scrolling text in a window.  

I have the beginnings of an application that reads troff ditroff output
and renders it on-screen.   The underlying libraries are 

	-lGL  -lglut -lX11 -lXi -lXft -lfontconfig -lcairo -lfreetype

Let's say the rendering has room for improvement, and is already better
than xman(1).  

My question is: how to scroll pages of text?  

The troff output is potentially many pages, and the user will want to
scroll up and down, as he does, say, viewing the bash(1) manual in GNU
less(1).  

Currently I open a cairo surface on the main window.  Scrolling a
screen of text up one line would require ... something. I could erase
the whole thing and start over with line 2 at the top, replacing line
1.  

An alternative, I think, is to render the whole document to a bitmap,
and scroll the bitmap up and down using just X primitives.  That
seems like it would be much faster and less flickery for the user. 

What's the accepted way to do it?  

--jkl



More information about the xorg mailing list