Re: Snappy GUI response

Owen Taylor <[email protected]>
Newsgroups gmane.comp.xfree86.forum
Message-ID <[email protected]>
On Fri, 2003-07-04 at 14:05, Mark Vojkovich wrote:

> > And how many billions of pixels a second of constant fill can a
> > modern nvidia card? Optimizing out XFillRectangle() doesn't strike
> > me as being that important.
> 
>    It's not the actually drawing that is a problem.  It's having
> to get an expose event at all.  If a button rarely changes, set
> the image as a window background and request no expose events
> on it.
> 
>    I advocate backing pixmaps for as many windows as it 
> makes sense, and no expose events on them.  Not only is this
> extremely fast even if server is rendering in software, but
> it looks great (you don't see redrawing).  That is, save all
> your expensive rendering, don't keep redrawing it.  Put it in
> a pixmap and set it as the window background.  There's also
> a good change this pixmap will end up in video ram rather than 
> system ram.

Saving the full contents of each toplevel window makes a lot
of sense these days. Doing it in the toolkit doesn't:

 * If the windowing system saves the full contents of each
   toplevel (see below for why that works better), then you
   double the 50+ megabytes of memory you are using by
   saving the full contents of each window in the toolkit.

   The directfb and OS X servers are current examples of
   servers that save the full contents of each window.

 * The windowing system, if it has the full contents, can
   do neat things like per-window alpha channels.

 * The windowing system is generally in a much better position
   to know when to dump the window contents and ask the app to
   redraw them. (because you are out of memory, because 
   the window is fully obscured or on a different desktop, etc.)

Regards,
					Owen

[ You could argue that only "expensive" windows should save
  their contents in the toolkit, but that's a real hard
  thing to define. There is no reason why a web browser 
  should be expensive, really... ]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.