desktop: cache photo and geo icons

The icons shown in the dive list were rendered for every single
access. Render them only once. This supposes that the
defaultIconMetrics structure does not change once the icons are
rendered!

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-02-10 22:16:25 +01:00 committed by Dirk Hohndel
parent 41df39fdbe
commit b3e4c9c8da
3 changed files with 31 additions and 11 deletions

View file

@ -43,7 +43,7 @@ static int defaultIconSize(int height)
return ret;
}
const IconMetrics & defaultIconMetrics()
const IconMetrics &defaultIconMetrics()
{
if (dfltIconMetrics.sz_small == -1) {
int small = defaultIconSize(defaultModelFontMetrics().height());