Why do we draw so much

Subject: Why do we draw so much
From: Thomas Fletcher (thomasf@qnx.com)
Date: Fri Mar 17 2000 - 07:26:33 CST

Hey all,

  Well I was looking at the Photon version of AbiWord trying
to figure out why certain operations seemed to be really
slow on my P133 ... and I've found something interesting
(as I usually do when I totally walk a source through the

  Photon heavily makes use of damage rectangles when you get
expose events. For example moving a window on top of another
might generate one expose event which _lots_ of tiny slivers
of expose rectangles all chained together. As a result I
would call the draw() routine with this clipping rectangle
a large number of times .... this was killing my performance
and I think I see why.

 Take scrolling for example. When we scroll we call the
graphics routine to scroll, then we clip to the newly
uncovered area, and then we proceed to go and draw each
line/block of text on that page regardless of whether
it is outside of that clipping region ... letting go
all the way through to the graphics class which then
will promptly ignore the text.

  Since we already have the sizing information on the text,
wouldn't it be smarter to avoid some of this processing if
we have a clipping region? At the very least stop doing
the processing after our insertion point has passed the
bottom of the clipping region.

  Unless someone has some big objections, I'm going to look
into this. I was trying to write a technical presentation
with AbiWord (god do I ever need bullets!) and this was just
killing me!

I'll be back with the results shortly I hope.

Thomas (toe-mah) Fletcher QNX Software Systems
thomasf@qnx.com Neutrino Development Group
(613)-591-0931 http://www.qnx.com/~thomasf

This archive was generated by hypermail 2b25 : Fri Mar 17 2000 - 07:26:45 CST