backends/drm: add more nullptr checks for m_surface
BUG: 475380
This commit is contained in:
parent
ed1969c3d9
commit
aaffd459ce
1 changed files with 11 additions and 3 deletions
|
@ -191,12 +191,16 @@ EglGbmBackend *EglGbmLayerSurface::eglBackend() const
|
|||
|
||||
std::shared_ptr<DrmFramebuffer> EglGbmLayerSurface::currentBuffer() const
|
||||
{
|
||||
return m_surface->currentFramebuffer;
|
||||
return m_surface ? m_surface->currentFramebuffer : nullptr;
|
||||
}
|
||||
|
||||
const ColorDescription &EglGbmLayerSurface::colorDescription() const
|
||||
{
|
||||
if (m_surface) {
|
||||
return m_surface->shadowTexture ? m_surface->intermediaryColorDescription : m_surface->targetColorDescription;
|
||||
} else {
|
||||
return ColorDescription::sRGB;
|
||||
}
|
||||
}
|
||||
|
||||
bool EglGbmLayerSurface::doesSurfaceFit(const QSize &size, const QMap<uint32_t, QVector<uint64_t>> &formats) const
|
||||
|
@ -206,7 +210,11 @@ bool EglGbmLayerSurface::doesSurfaceFit(const QSize &size, const QMap<uint32_t,
|
|||
|
||||
std::shared_ptr<GLTexture> EglGbmLayerSurface::texture() const
|
||||
{
|
||||
if (m_surface) {
|
||||
return m_surface->shadowTexture ? m_surface->shadowTexture : m_surface->currentSlot->texture();
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<DrmFramebuffer> EglGbmLayerSurface::renderTestBuffer(const QSize &bufferSize, const QMap<uint32_t, QVector<uint64_t>> &formats)
|
||||
|
|
Loading…
Reference in a new issue