/* This file is part of Telegram Desktop, the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once #include "calls/group/calls_group_viewport.h" #include "ui/gl/gl_surface.h" #include #include namespace Calls::Group { class Viewport::RendererGL final : public Ui::GL::Renderer { public: explicit RendererGL(not_null owner); void free(const Textures &textures); void init( not_null widget, not_null f) override; void deinit( not_null widget, not_null f) override; void resize( not_null widget, not_null f, int w, int h) override; void paint( not_null widget, not_null f) override; private: void fillBackground(not_null f); void paintTile( not_null f, not_null tile); void freeTextures(not_null f); [[nodiscard]] QRect tileGeometry(not_null tile) const; void ensureARGB32Program(); const not_null _owner; GLfloat _factor = 1.; QSize _viewport; std::optional _frameBuffer; std::optional _bgBuffer; std::optional _argb32Program; std::optional _yuv420Program; std::optional _bgProgram; QOpenGLShader *_frameVertexShader = nullptr; std::vector _bgTriangles; std::vector _texturesToFree; }; } // namespace Calls::Group