diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /dom/canvas/WebGLTextureUpload.cpp | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/canvas/WebGLTextureUpload.cpp')
-rw-r--r-- | dom/canvas/WebGLTextureUpload.cpp | 22 |
1 files changed, 5 insertions, 17 deletions
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<TexUnpackBlobDesc> FromImageBitmap(const GLenum target, Maybe<uvec3> size, } const RefPtr<gfx::DataSourceSurface> 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<RawBuffer<>> 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; |