diff --git a/Telegram/SourceFiles/calls/group/calls_group_viewport.h b/Telegram/SourceFiles/calls/group/calls_group_viewport.h index 63aa9b79e1..9ae603210d 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_viewport.h +++ b/Telegram/SourceFiles/calls/group/calls_group_viewport.h @@ -89,8 +89,6 @@ public: [[nodiscard]] rpl::producer qualityRequests() const; [[nodiscard]] rpl::producer mouseInsideValue() const; - [[nodiscard]] uint32 defaultFramebufferObject() const; - [[nodiscard]] rpl::lifetime &lifetime(); private: @@ -136,8 +134,8 @@ private: [[nodiscard]] Ui::GL::ChosenRenderer chooseRenderer( Ui::GL::Capabilities capabilities); - bool _opengl = false; PanelMode _mode = PanelMode(); + bool _opengl = false; bool _geometryStaleAfterModeChange = false; const std::unique_ptr _content; std::vector> _tiles; diff --git a/Telegram/SourceFiles/calls/group/calls_group_viewport_opengl.cpp b/Telegram/SourceFiles/calls/group/calls_group_viewport_opengl.cpp index eaf85ea912..ec133e90de 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_viewport_opengl.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_viewport_opengl.cpp @@ -936,13 +936,15 @@ void Viewport::RendererGL::validateDatas() { if (width > available) { available = width; } - const auto peer = tiles[i]->row()->peer(); - const auto j = ranges::find(_tileData, peer, &TileData::peer); + const auto id = quintptr(tiles[i]->track().get()); + const auto j = ranges::find(_tileData, id, &TileData::id); if (j != end(_tileData)) { j->stale = false; const auto index = (j - begin(_tileData)); _tileDataIndices[i] = index; - if (peer->nameVersion != j->nameVersion + const auto peer = tiles[i]->row()->peer(); + if (peer != j->peer + || peer->nameVersion != j->nameVersion || width != j->nameRect.width()) { const auto nameTop = index * nameHeight; j->nameRect = QRect(0, nameTop, width, nameHeight); @@ -963,6 +965,7 @@ void Viewport::RendererGL::validateDatas() { if (_tileDataIndices[i] >= 0) { continue; } + const auto id = quintptr(tiles[i]->track().get()); const auto peer = tiles[i]->row()->peer(); auto index = int(_tileData.size()); maybeStaleAfter = ranges::find( @@ -972,12 +975,16 @@ void Viewport::RendererGL::validateDatas() { &TileData::stale); if (maybeStaleAfter != maybeStaleEnd) { index = (maybeStaleAfter - begin(_tileData)); + maybeStaleAfter->id = id; maybeStaleAfter->peer = peer; maybeStaleAfter->stale = false; request.updating = true; } else { // This invalidates maybeStale*, but they're already equal. - _tileData.push_back({ .peer = peer }); + _tileData.push_back({ + .id = id, + .peer = peer, + }); } _tileData[index].nameVersion = peer->nameVersion; _tileData[index].nameRect = QRect( diff --git a/Telegram/SourceFiles/calls/group/calls_group_viewport_opengl.h b/Telegram/SourceFiles/calls/group/calls_group_viewport_opengl.h index d821fb387f..699ad8fc02 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_viewport_opengl.h +++ b/Telegram/SourceFiles/calls/group/calls_group_viewport_opengl.h @@ -47,13 +47,14 @@ public: private: struct TileData { - not_null peer; + quintptr id = 0; Ui::GL::Textures<5> textures; Ui::GL::Framebuffers<2> framebuffers; mutable int textureIndex = 0; mutable int trackIndex = -1; Ui::Animations::Simple outlined; QRect nameRect; + not_null peer; int nameVersion = 0; bool stale = false; bool outline = false;