screencasting: No need to keep calculating the textureSize

This commit is contained in:
Aleix Pol 2022-11-02 19:48:40 +01:00
parent d5a2c639a0
commit eb7f93002c

View file

@ -375,8 +375,9 @@ void ScreenCastStream::recordFrame(const QRegion &_damagedRegion)
return; return;
} }
if (m_source->textureSize() != m_resolution) { const auto size = m_source->textureSize();
m_resolution = m_source->textureSize(); if (size != m_resolution) {
m_resolution = size;
newStreamParams(); newStreamParams();
return; return;
} }
@ -406,7 +407,6 @@ void ScreenCastStream::recordFrame(const QRegion &_damagedRegion)
return; return;
} }
const auto size = m_source->textureSize();
spa_data->chunk->offset = 0; spa_data->chunk->offset = 0;
if (data || spa_data[0].type == SPA_DATA_MemFd) { if (data || spa_data[0].type == SPA_DATA_MemFd) {
const bool hasAlpha = m_source->hasAlphaChannel(); const bool hasAlpha = m_source->hasAlphaChannel();