Bug 1675876 - Make RenderBufferTextureHostSWGL::RenderBufferTextureHostSWGL() fallible r=mattwoodrow

When ShmemTextureHost does not have valid Shmem, RenderBufferTextureHostSWGL::mBuffer is nullptr. RenderBufferTextureHost and RenderExternalTextureHost handle it as fallible.

Differential Revision: https://phabricator.services.mozilla.com/D103427
This commit is contained in:
sotaro 2021-02-01 03:06:00 +00:00
Родитель ea86c0a39e
Коммит d26e04b806
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -20,7 +20,6 @@ RenderBufferTextureHostSWGL::RenderBufferTextureHostSWGL(
switch (mDescriptor.type()) {
case layers::BufferDescriptor::TYCbCrDescriptor:
case layers::BufferDescriptor::TRGBDescriptor:
MOZ_RELEASE_ASSERT(mBuffer != nullptr);
break;
default:
gfxCriticalError() << "Bad buffer host descriptor "
@ -72,6 +71,12 @@ gfx::YUVColorSpace RenderBufferTextureHostSWGL::GetYUVColorSpace() const {
bool RenderBufferTextureHostSWGL::MapPlane(RenderCompositor* aCompositor,
uint8_t aChannelIndex,
PlaneInfo& aPlaneInfo) {
if (!mBuffer) {
// We hit some problems to get the shmem.
gfxCriticalNote << "GetBuffer Failed";
return false;
}
switch (mDescriptor.type()) {
case layers::BufferDescriptor::TYCbCrDescriptor: {
const layers::YCbCrDescriptor& desc = mDescriptor.get_YCbCrDescriptor();