backends/drm: correct test buffer check

There can be situations where the surface fits but there's no test buffer yet
This commit is contained in:
Xaver Hugl 2022-10-01 20:57:33 +02:00
parent 2bda46d5b9
commit 1f92dc5e5d

View file

@ -68,7 +68,7 @@ QRegion EglGbmLayer::currentDamage() const
bool EglGbmLayer::checkTestBuffer()
{
if (!m_surface.doesSurfaceFit(m_pipeline->bufferSize(), m_pipeline->formats())) {
if (!m_currentBuffer || !m_surface.doesSurfaceFit(m_pipeline->bufferSize(), m_pipeline->formats())) {
const auto buffer = m_surface.renderTestBuffer(m_pipeline->bufferSize(), m_pipeline->formats());
if (!buffer) {
return false;