mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Optimized video frame pushing.
This commit is contained in:
@@ -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);
|
||||
|
@@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user