2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Cache reaction lottie in Window::SessionController.

This commit is contained in:
John Preston
2022-01-10 23:44:05 +03:00
parent 3b4ed03105
commit e032dbf383
6 changed files with 75 additions and 20 deletions

View File

@@ -57,6 +57,10 @@ struct CloudTheme;
enum class CloudThemeType;
} // namespace Data
namespace HistoryView::Reactions {
class CachedIconFactory;
} // namespace HistoryView::Reactions
namespace Window {
class MainWindow;
@@ -450,6 +454,11 @@ public:
return _chatStyle.get();
}
[[nodiscard]] auto cachedReactionIconFactory() const
-> HistoryView::Reactions::CachedIconFactory & {
return *_cachedReactionIconFactory;
}
rpl::lifetime &lifetime() {
return _lifetime;
}
@@ -527,6 +536,9 @@ private:
std::deque<std::shared_ptr<Ui::ChatTheme>> _lastUsedCustomChatThemes;
rpl::variable<PeerThemeOverride> _peerThemeOverride;
using ReactionIconFactory = HistoryView::Reactions::CachedIconFactory;
std::unique_ptr<ReactionIconFactory> _cachedReactionIconFactory;
rpl::lifetime _lifetime;
};