media_view_pip_raster.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 "media/view/media_view_pip_renderer.h"
  9. namespace Media::View {
  10. class Pip::RendererSW final : public Pip::Renderer {
  11. public:
  12. explicit RendererSW(not_null<Pip*> owner);
  13. void paintFallback(
  14. Painter &&p,
  15. const QRegion &clip,
  16. Ui::GL::Backend backend) override;
  17. private:
  18. void paintTransformedVideoFrame(ContentGeometry geometry) override;
  19. void paintTransformedStaticContent(
  20. const QImage &image,
  21. ContentGeometry geometry) override;
  22. void paintTransformedImage(
  23. const QImage &image,
  24. ContentGeometry geometry);
  25. void paintRadialLoading(
  26. QRect inner,
  27. float64 controlsShown) override;
  28. void paintButtonsStart() override;
  29. void paintButton(
  30. const Button &button,
  31. int outerWidth,
  32. float64 shown,
  33. float64 over,
  34. const style::icon &icon,
  35. const style::icon &iconOver) override;
  36. void paintPlayback(QRect outer, float64 shown) override;
  37. void paintVolumeController(QRect outer, float64 shown) override;
  38. void paintFade(ContentGeometry geometry) const;
  39. [[nodiscard]] FrameRequest frameRequest(ContentGeometry geometry) const;
  40. [[nodiscard]] QImage staticContentByRequest(
  41. const QImage &image,
  42. const FrameRequest &request);
  43. const not_null<Pip*> _owner;
  44. Painter *_p = nullptr;
  45. const QRegion *_clip = nullptr;
  46. QRect _clipOuter;
  47. Ui::RoundRect _roundRect;
  48. QImage _preparedStaticContent;
  49. FrameRequest _preparedStaticRequest;
  50. qint64 _preparedStaticKey = 0;
  51. };
  52. } // namespace Media::View