2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Optimized video frame pushing.

This commit is contained in:
John Preston
2019-03-07 17:23:19 +04:00
parent 5c4b459f57
commit a56a12a1ef
9 changed files with 143 additions and 54 deletions

View File

@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/effects/animations.h"
#include "core/application.h"
#include "core/sandbox.h"
namespace Ui {
namespace Animations {
@@ -32,6 +33,13 @@ void Basic::stop() {
}
}
Manager::Manager() {
Core::Sandbox::Instance().widgetUpdateRequests(
) | rpl::start_with_next([=] {
update();
}, _lifetime);
}
void Manager::start(not_null<Basic*> animation) {
if (_updating) {
_starting.push_back(animation);

View File

@@ -93,6 +93,8 @@ private:
class Manager final : private QObject {
public:
Manager();
void update();
private:
@@ -113,6 +115,7 @@ private:
bool _scheduled = false;
std::vector<Basic*> _active;
std::vector<not_null<Basic*>> _starting;
rpl::lifetime _lifetime;
};

View File

@@ -55,12 +55,9 @@ void ContinuousSlider::setValue(float64 value) {
void ContinuousSlider::setValue(float64 value, float64 receivedTill) {
if (_value != value || _receivedTill != receivedTill) {
LOG(("UPDATED"));
_value = value;
_receivedTill = receivedTill;
update();
} else {
LOG(("SKIPPED"));
}
}