Support rendering Webm videos with alpha.

This commit is contained in:
John Preston
2022-01-19 17:45:51 +03:00
parent 1755ead681
commit 8b7d2c880e
25 changed files with 139 additions and 44 deletions

View File

@@ -49,7 +49,7 @@ enum class FileType {
|| owner->isAnimation()
|| owner->isWallPaper()
|| owner->isTheme()
|| (owner->sticker() && owner->sticker()->animated);
|| (owner->sticker() && owner->sticker()->isAnimated());
}
[[nodiscard]] QImage PrepareGoodThumbnail(
@@ -260,7 +260,7 @@ void DocumentMedia::checkStickerLarge() {
return;
}
automaticLoad(_owner->stickerSetOrigin(), nullptr);
if (data->animated || !loaded()) {
if (data->isAnimated() || !loaded()) {
return;
}
if (_bytes.isEmpty()) {
@@ -366,9 +366,9 @@ bool DocumentMedia::thumbnailEnoughForSticker() const {
void DocumentMedia::checkStickerSmall() {
const auto data = _owner->sticker();
if ((data && data->animated) || thumbnailEnoughForSticker()) {
if ((data && data->isAnimated()) || thumbnailEnoughForSticker()) {
_owner->loadThumbnail(_owner->stickerSetOrigin());
if (data && data->animated) {
if (data && data->isAnimated()) {
automaticLoad(_owner->stickerSetOrigin(), nullptr);
}
} else {
@@ -383,7 +383,7 @@ Image *DocumentMedia::getStickerLarge() {
Image *DocumentMedia::getStickerSmall() {
const auto data = _owner->sticker();
if ((data && data->animated) || thumbnailEnoughForSticker()) {
if ((data && data->isAnimated()) || thumbnailEnoughForSticker()) {
return thumbnail();
}
return _sticker.get();