summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-02-10 22:16:25 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-02-10 14:33:15 -0800
commitb3e4c9c8daee8df29c7d6fc943e37886217d3c98 (patch)
tree3deac4ca5344f82394bf96627dda737f87fa292c /core
parent41df39fdbe22fed32cee28a0035ee283dc49b79b (diff)
downloadsubsurface-b3e4c9c8daee8df29c7d6fc943e37886217d3c98.tar.gz
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>
Diffstat (limited to 'core')
-rw-r--r--core/metrics.cpp2
-rw-r--r--core/metrics.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/metrics.cpp b/core/metrics.cpp
index 9351bcb0d..7316487a1 100644
--- a/core/metrics.cpp
+++ b/core/metrics.cpp
@@ -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());
diff --git a/core/metrics.h b/core/metrics.h
index 4c636bcc4..e345213a7 100644
--- a/core/metrics.h
+++ b/core/metrics.h
@@ -31,7 +31,7 @@ struct IconMetrics {
IconMetrics();
};
-const IconMetrics & defaultIconMetrics();
+const IconMetrics &defaultIconMetrics();
void updateDevicePixelRatio(double dpr);
#endif // METRICS_H