backends/drm: fix crash in aboutToStartPainting
m_gbmSurface may still be nullptr
This commit is contained in:
parent
0cd453690b
commit
36088cc82c
2 changed files with 2 additions and 2 deletions
|
@ -123,7 +123,7 @@ std::optional<QRegion> EglGbmLayer::startRendering()
|
|||
|
||||
void EglGbmLayer::aboutToStartPainting(const QRegion &damagedRegion)
|
||||
{
|
||||
if (m_gbmSurface->bufferAge() > 0 && !damagedRegion.isEmpty() && m_eglBackend->supportsPartialUpdate()) {
|
||||
if (m_gbmSurface && m_gbmSurface->bufferAge() > 0 && !damagedRegion.isEmpty() && m_eglBackend->supportsPartialUpdate()) {
|
||||
QVector<EGLint> rects = m_pipeline->output()->regionToRects(damagedRegion);
|
||||
const bool correct = eglSetDamageRegionKHR(m_eglBackend->eglDisplay(), m_gbmSurface->eglSurface(), rects.data(), rects.count() / 4);
|
||||
if (!correct) {
|
||||
|
|
|
@ -50,7 +50,7 @@ void VirtualEglGbmLayer::destroyResources()
|
|||
|
||||
void VirtualEglGbmLayer::aboutToStartPainting(const QRegion &damagedRegion)
|
||||
{
|
||||
if (m_gbmSurface->bufferAge() > 0 && !damagedRegion.isEmpty() && m_eglBackend->supportsPartialUpdate()) {
|
||||
if (m_gbmSurface && m_gbmSurface->bufferAge() > 0 && !damagedRegion.isEmpty() && m_eglBackend->supportsPartialUpdate()) {
|
||||
const QRegion region = damagedRegion & m_output->geometry();
|
||||
|
||||
QVector<EGLint> rects = m_output->regionToRects(region);
|
||||
|
|
Loading…
Reference in a new issue