2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35: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

@@ -500,8 +500,16 @@ bool Sandbox::notify(QObject *receiver, QEvent *e) {
const auto wrap = createEventNestingLevel();
const auto type = e->type();
if ((type == QEvent::UpdateRequest) && _application) {
_application->animationManager().update();
if (type == QEvent::UpdateRequest) {
_widgetUpdateRequests.fire({});
// Profiling.
//const auto time = crl::now();
//LOG(("[%1] UPDATE STARTED").arg(time));
//const auto guard = gsl::finally([&] {
// const auto now = crl::now();
// LOG(("[%1] UPDATE FINISHED (%2)").arg(now).arg(now - time));
//});
//return QApplication::notify(receiver, e);
}
return QApplication::notify(receiver, e);
}
@@ -550,6 +558,10 @@ void Sandbox::resumeDelayedWindowActivations() {
_delayedActivationsPaused = false;
}
rpl::producer<> Sandbox::widgetUpdateRequests() const {
return _widgetUpdateRequests.events();
}
ProxyData Sandbox::sandboxProxy() const {
return _sandboxProxy;
}

View File

@@ -39,6 +39,8 @@ public:
void pauseDelayedWindowActivations();
void resumeDelayedWindowActivations();
rpl::producer<> widgetUpdateRequests() const;
ProxyData sandboxProxy() const;
static Sandbox &Instance() {
@@ -109,6 +111,8 @@ private:
QByteArray _lastCrashDump;
ProxyData _sandboxProxy;
rpl::event_stream<> _widgetUpdateRequests;
};
} // namespace Core