You are not logged in.
Alright, so I'm new to cairo in general, and I'm working on a project written in C using cairo and xlib.
One of the things it's meant to do is prompt the user for their password, and display the masked password (i.e. "******"). Now, the masked password should be updated on each keypress, which is easy to do. The naive solution, however, has a serious drawback, in that it draws the whole string on each keypress. Because the text is antialiased, this introduces visual artifacts that build up with each subsequent key press. And, should the user press backspace, the old password mask will still show under the new, shorter mask.
Clearing the surface isn't an option, because there are other images that have been drawn with cairo on the surface. So, what I'm trying to figure out is how to selectively update part of a cairo surface while preserving what's already been drawn on it. I've looked through several demos of cairo, but none seem to tackle this issue; at most, they redraw the entire surface every time something is updated, which I could do, but it would introduce flickering as the background is a bit complicated and is drawn in several steps.
Any help would be appreciated. Example projects to look at would also be great. I haven't found much that uses cairo and xlib directly outside of a handful of demos.
Offline