From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- dom/canvas/WebGLTextureUpload.cpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'dom/canvas/WebGLTextureUpload.cpp') diff --git a/dom/canvas/WebGLTextureUpload.cpp b/dom/canvas/WebGLTextureUpload.cpp index 6686c34178..1a439ca5bc 100644 --- a/dom/canvas/WebGLTextureUpload.cpp +++ b/dom/canvas/WebGLTextureUpload.cpp @@ -60,6 +60,10 @@ Maybe FromImageBitmap(const GLenum target, Maybe size, } const RefPtr surf = cloneData->mSurface; + if (NS_WARN_IF(!surf)) { + return {}; + } + const auto imageSize = *uvec2::FromSize(surf->GetSize()); if (!size) { size.emplace(imageSize.x, imageSize.y, 1); @@ -925,23 +929,7 @@ void WebGLTexture::TexStorage(TexTarget target, uint32_t levels, void WebGLTexture::TexImage(uint32_t level, GLenum respecFormat, const uvec3& offset, const webgl::PackingInfo& pi, const webgl::TexUnpackBlobDesc& src) { - Maybe> cpuDataView; - if (src.cpuData) { - cpuDataView = Some(RawBuffer<>{src.cpuData->Data()}); - } - const auto srcViewDesc = webgl::TexUnpackBlobDesc{src.imageTarget, - src.size, - src.srcAlphaType, - std::move(cpuDataView), - src.pboOffset, - src.structuredSrcSize, - src.image, - src.sd, - src.dataSurf, - src.unpacking, - src.applyUnpackTransforms}; - - const auto blob = webgl::TexUnpackBlob::Create(srcViewDesc); + const auto blob = webgl::TexUnpackBlob::Create(src); if (!blob) { MOZ_ASSERT(false); return; -- cgit v1.2.3