From b3e4c9c8daee8df29c7d6fc943e37886217d3c98 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 10 Feb 2021 22:16:25 +0100 Subject: 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 --- core/metrics.cpp | 2 +- core/metrics.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'core') 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 -- cgit v1.2.3-70-g09d2