Bug 1878930 - s/RawBuffer/Span/: TexImage: Use span, fix dtwebgl callers. r=gfx-reviewers,lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D202027
This commit is contained in:
Kelsey Gilbert
2024-02-20 17:59:08 +00:00
parent 036bbae6bb
commit 15143f68a7
4 changed files with 15 additions and 19 deletions

View File

@@ -4142,7 +4142,8 @@ void webgl::TexUnpackBlobDesc::Shrink(const webgl::PackingInfo& pi) {
CheckedInt<size_t>(unpack.metrics.bytesPerRowStride) *
unpack.metrics.totalRows;
if (bytesUpperBound.isValid()) {
cpuData->Shrink(bytesUpperBound.value());
auto& span = *cpuData;
span = span.subspan(0, std::min(span.size(), bytesUpperBound.value()));
}
}
}
@@ -4218,7 +4219,7 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget,
return Some(webgl::TexUnpackBlobDesc{imageTarget,
size.value(),
gfxAlphaType::NonPremult,
Some(RawBuffer<>{*range}),
Some(*range),
{}});
});
}