Commit 077cf038 authored by sotaro's avatar sotaro
Browse files

Bug 1851432 - Add error handling to WebGLContext::PushRemoteTexture()...

Bug 1851432 - Add error handling to WebGLContext::PushRemoteTexture() r=gfx-reviewers,lsalzman a=RyanVM

SharedSurface_DMABUF::ToSurfaceDescriptor() could return Nothing() with error. It needs to be handled as failure.

SharedSurface::ToSurfaceDescriptor() is expected to return Nothing() only with SharedSurface_Basic.

Differential Revision: https://phabricator.services.mozilla.com/D188078
parent bdfa6606
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1173,6 +1173,9 @@ bool WebGLContext::PushRemoteTexture(WebGLFramebuffer* fb,
    desc = surf->ToSurfaceDescriptor();
  }
  if (!desc) {
    if (surf && surf->mDesc.type != gl::SharedSurfaceType::Basic) {
      return onFailure();
    }
    // If we can't serialize to a surface descriptor, then we need to create
    // a buffer to read back into that will become the remote texture.
    auto data = mRemoteTextureOwner->CreateOrRecycleBufferTextureData(