2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Testing crl (concurrency runtime library).

This commit is contained in:
John Preston
2017-12-17 22:41:34 +04:00
parent 499e3113b9
commit b8204a317d
11 changed files with 232 additions and 7 deletions

View File

@@ -1596,9 +1596,9 @@ void MediaView::initThemePreview() {
current.backgroundId = Window::Theme::Background()->id();
current.backgroundImage = Window::Theme::Background()->pixmap();
current.backgroundTiled = Window::Theme::Background()->tile();
base::TaskQueue::Normal().Put([ready = std::move(ready), path, current]() mutable {
crl::async([=] {
auto preview = Window::Theme::GeneratePreview(path, current);
base::TaskQueue::Main().Put([ready = std::move(ready), result = std::move(preview)]() mutable {
crl::on_main([ready, result = std::move(preview)]() mutable {
ready(std::move(result));
});
});