2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

OpenGL render of frames in single widget.

This commit is contained in:
John Preston
2021-05-24 00:11:24 +04:00
parent ec468431b4
commit d44f923277
10 changed files with 349 additions and 107 deletions

View File

@@ -134,7 +134,9 @@ Ui::GL::ChosenRenderer Panel::Incoming::chooseRenderer(
}
void Panel::Incoming::paint(QPainter &p, const QRegion &clip, bool opengl) {
const auto [image, rotation] = _track->frameOriginalWithRotation();
const auto data = _track->frameWithInfo();
const auto &image = data.original;
const auto rotation = data.rotation;
if (image.isNull()) {
p.fillRect(clip.boundingRect(), Qt::black);
} else {
@@ -517,10 +519,7 @@ void Panel::reinitWithCall(Call *call) {
_call->videoIncoming()->renderNextFrame(
) | rpl::start_with_next([=] {
const auto track = _call->videoIncoming();
const auto [frame, rotation] = track->frameOriginalWithRotation();
setIncomingSize((rotation == 90 || rotation == 270)
? QSize(frame.height(), frame.width())
: frame.size());
setIncomingSize(track->frameSize());
if (_incoming->widget()->isHidden()) {
return;
}