calls_group_viewport_raster.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "calls/group/calls_group_viewport.h"
  9. #include "ui/round_rect.h"
  10. #include "ui/effects/cross_line.h"
  11. #include "ui/gl/gl_surface.h"
  12. #include "ui/text/text.h"
  13. namespace Calls::Group {
  14. class Viewport::RendererSW final : public Ui::GL::Renderer {
  15. public:
  16. explicit RendererSW(not_null<Viewport*> owner);
  17. void paintFallback(
  18. Painter &&p,
  19. const QRegion &clip,
  20. Ui::GL::Backend backend) override;
  21. private:
  22. struct TileData {
  23. QImage userpicFrame;
  24. QImage blurredFrame;
  25. bool stale = false;
  26. };
  27. void paintTile(
  28. Painter &p,
  29. not_null<VideoTile*> tile,
  30. const QRect &clip,
  31. QRegion &bg);
  32. void paintTileOutline(
  33. Painter &p,
  34. int x,
  35. int y,
  36. int width,
  37. int height,
  38. not_null<VideoTile*> tile);
  39. void paintTileControls(
  40. Painter &p,
  41. int x,
  42. int y,
  43. int width,
  44. int height,
  45. not_null<VideoTile*> tile);
  46. void validateUserpicFrame(
  47. not_null<VideoTile*> tile,
  48. TileData &data);
  49. const not_null<Viewport*> _owner;
  50. QImage _shadow;
  51. bool _userpicFrame = false;
  52. bool _pausedFrame = false;
  53. base::flat_map<not_null<VideoTile*>, TileData> _tileData;
  54. Ui::CrossLineAnimation _pinIcon;
  55. Ui::RoundRect _pinBackground;
  56. };
  57. } // namespace Calls::Group