millennium-dev team mailing list archive
-
millennium-dev team
-
Mailing list archive
-
Message #00113
[Bug 1204559] [NEW] Drawing widgets is time-consuming
Public bug reported:
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.
** Affects: millenniumduel
Importance: High
Status: Triaged
--
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:
Triaged
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
Follow ups
References