Speeding up plotting widget

Michael Pyne mpyne at purinchu.net
Mon Jun 9 22:31:41 BST 2008

On Monday 09 June 2008, John Tapsell wrote:
> There seem to be other reasons as to why it's slow, but this seems to
> be a good place to start.  Why would drawing dashed lines be so slow?
> (It's about 10 horizontal lines, stretching across my screen (so about
> 1000 pixels long).

Well I'm willing to bet it's because one of these is really easy to hardware 
accelerate (solid lines), and no so much for dashed lines.

Think about how you would implement it.  For dashed lines you would have to 
run a loop, calculate the start and end, make sure both are in bounds, draw a 
solid line.  Then advance past the end, calculate new start and end, draw, 
etc.  Until your new start position is past the end.  Although the line 
drawing steps could be hardware accelerated there's a lot of overhead in 

With a solid line you just specify start/end, do bounds checking, and draw.  
It can be especially fast for horizontal lines IIRC.

However this could all depend on your acceleration architecture (XAA vs. EXA), 
particular driver used, etc.

If it makes you feel better I deal with the same thing in a sensor widget I 
have been trying to develop off and on. 10% does seem a bit much for a plotter 
though. :-/

 - Michael Pyne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080609/1bf34c82/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080609/1bf34c82/attachment.sig>

More information about the kde-core-devel mailing list