← Back to team overview

millennium-dev team mailing list archive

[Bug 1204559] Re: Drawing widgets is time-consuming

 

** Changed in: millenniumduel
       Status: Triaged => Fix Committed

-- 
You received this bug notification because you are a member of
Millennium Developers, which is subscribed to Millennium Duel.
https://bugs.launchpad.net/bugs/1204559

Title:
  Drawing widgets is time-consuming

Status in Millennium Duel - a GUI frontend for Millennium:
  Fix Committed

Bug description:
  The drawing model we currently use is extremely inefficient.

  The display keeps redrawing relentlessly. Each time we process all
  visible widgets and redraw them. With a larger number of widgets, the
  interface will start lagging.

  I've run valgrind's profiler, and it turns out that about 50% of code
  execution time is spend rendering fonts.

  Why don't we render them once, and use a pre-rendered bitmap next times?
  Of course, the bitmap would need to be re-rendered when the text is changed or the drawing area resizes. But that happens relatively rarely, and therefore such approach would improve our efficiency a lot.

  This concept may be generalised, let all drawables have a needs_redraw
  flag that causes the pre-rendered "buffer" bitmap to be redrawn, and
  in all other cases draw() would simply use that buffer to draw onto
  the display.

To manage notifications about this bug go to:
https://bugs.launchpad.net/millenniumduel/+bug/1204559/+subscriptions


References