summaryrefslogtreecommitdiffstats
path: root/dom/canvas/WebGLTextureUpload.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /dom/canvas/WebGLTextureUpload.cpp
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-upstream/125.0.1.tar.xz
firefox-upstream/125.0.1.zip
Adding upstream version 125.0.1.upstream/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.cpp22
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;