Fix build with Xcode.

This commit is contained in:
John Preston 2022-07-08 22:44:26 +04:00
parent ddd5021966
commit a7e295ae64
4 changed files with 8 additions and 12 deletions

View file

@ -1057,7 +1057,6 @@ void EmojiListWidget::refreshCustom() {
if (document->sticker()) { if (document->sticker()) {
auto i = _instances.find(document->id); auto i = _instances.find(document->id);
if (i == end(_instances)) { if (i == end(_instances)) {
using Loading = Ui::CustomEmoji::Loading;
auto loader = owner->customEmojiManager().createLoader( auto loader = owner->customEmojiManager().createLoader(
document, document,
Data::CustomEmojiManager::SizeTag::Large); Data::CustomEmojiManager::SizeTag::Large);

View file

@ -70,10 +70,6 @@ private:
int _rotation = 0; int _rotation = 0;
//AVRational _aspect = kNormalAspect; //AVRational _aspect = kNormalAspect;
int _width = 0;
int _height = 0;
QSize _swsSize;
crl::time _framePosition = 0; crl::time _framePosition = 0;
int _nextFrameDelay = 0; int _nextFrameDelay = 0;
int _currentFrameDelay = 0; int _currentFrameDelay = 0;
@ -118,7 +114,7 @@ int EmojiGenerator::Impl::read(uint8_t *buf, int buf_size) {
if (available <= 0) { if (available <= 0) {
return -1; return -1;
} }
const auto fill = std::min(available, buf_size); const auto fill = std::min(int(available), buf_size);
memcpy(buf, _bytes.data() + _deviceOffset, fill); memcpy(buf, _bytes.data() + _deviceOffset, fill);
_deviceOffset += fill; _deviceOffset += fill;
return fill; return fill;
@ -187,7 +183,7 @@ EmojiGenerator::Frame EmojiGenerator::Impl::renderCurrent(
auto dst = storage.bits() + dx * sizeof(int32) + dy * dstPerLine; auto dst = storage.bits() + dx * sizeof(int32) + dy * dstPerLine;
if (srcSize == dstSize && bgra) { if (srcSize == dstSize && bgra) {
const auto srcPerLine = frame->linesize[0]; const auto srcPerLine = frame->linesize[0];
const auto perLine = std::min(srcPerLine, dstPerLine); const auto perLine = std::min(srcPerLine, int(dstPerLine));
auto src = frame->data[0]; auto src = frame->data[0];
for (auto y = 0, height = srcSize.height(); y != height; ++y) { for (auto y = 0, height = srcSize.height(); y != height; ++y) {
memcpy(dst, src, perLine); memcpy(dst, src, perLine);
@ -205,7 +201,7 @@ EmojiGenerator::Frame EmojiGenerator::Impl::renderCurrent(
// AV_NUM_DATA_POINTERS defined in AVFrame struct // AV_NUM_DATA_POINTERS defined in AVFrame struct
uint8_t *dstData[AV_NUM_DATA_POINTERS] = { dst, nullptr }; uint8_t *dstData[AV_NUM_DATA_POINTERS] = { dst, nullptr };
int dstLinesize[AV_NUM_DATA_POINTERS] = { dstPerLine, 0 }; int dstLinesize[AV_NUM_DATA_POINTERS] = { int(dstPerLine), 0 };
sws_scale( sws_scale(
_scale.get(), _scale.get(),
frame->data, frame->data,

View file

@ -304,7 +304,8 @@ PaintFrameResult Cache::paintCurrentFrame(
_shown = now; _shown = now;
} }
const auto info = frame(std::min(_frame, _frames - 1)); const auto info = frame(std::min(_frame, _frames - 1));
p.drawImage(QPoint(x, y), *info.image, info.source); const auto size = _size / style::DevicePixelRatio();
p.drawImage(QRect(x, y, size, size), *info.image, info.source);
const auto next = currentFrameFinishes(); const auto next = currentFrameFinishes();
const auto duration = next ? (next - _shown) : 0; const auto duration = next ? (next - _shown) : 0;
return { return {
@ -360,7 +361,7 @@ Renderer::Renderer(RendererDescriptor &&descriptor)
auto generator = factory(); auto generator = factory();
auto rendered = generator->renderNext( auto rendered = generator->renderNext(
QImage(), QImage(),
QSize(size, size) * style::DevicePixelRatio(), QSize(size, size),
Qt::KeepAspectRatio); Qt::KeepAspectRatio);
if (rendered.image.isNull()) { if (rendered.image.isNull()) {
return; return;
@ -422,7 +423,7 @@ void Renderer::renderNext(
]() mutable { ]() mutable {
auto rendered = generator->renderNext( auto rendered = generator->renderNext(
std::move(storage), std::move(storage),
QSize(size, size) * style::DevicePixelRatio(), QSize(size, size),
Qt::KeepAspectRatio); Qt::KeepAspectRatio);
crl::on_main(guard, [ crl::on_main(guard, [
=, =,

@ -1 +1 @@
Subproject commit a7074136b4d8ba17b623cf673afc054f3aa3145b Subproject commit e65d4965257d5ab4b6bcff99b51ee50f0b690843