Backed out 10 changesets (bug 1829026) for causing bug 1869760 and bug 1869738. a=backout
Backed out changeset 4c619422efe5 (bug 1829026) Backed out changeset 77da89c7dab7 (bug 1829026) Backed out changeset 19d28d8f75a4 (bug 1829026) Backed out changeset 674b60ba54b1 (bug 1829026) Backed out changeset 31935f164ef0 (bug 1829026) Backed out changeset 13c9bf69085f (bug 1829026) Backed out changeset 330a6732fc0b (bug 1829026) Backed out changeset 974c08a3791b (bug 1829026) Backed out changeset 3ba040642ddc (bug 1829026) Backed out changeset 9d9b3a68858c (bug 1829026)
This commit is contained in:
@@ -3494,8 +3494,27 @@ void ClientWebGLContext::BufferData(GLenum target,
|
||||
});
|
||||
}
|
||||
|
||||
void ClientWebGLContext::RawBufferData(GLenum target, const uint8_t* srcBytes,
|
||||
size_t srcLen, GLenum usage) {
|
||||
const FuncScope funcScope(*this, "bufferData");
|
||||
|
||||
const auto srcBuffer =
|
||||
srcBytes ? RawBuffer<>({srcBytes, srcLen}) : RawBuffer<>(srcLen);
|
||||
Run<RPROC(BufferData)>(target, srcBuffer, usage);
|
||||
}
|
||||
|
||||
////
|
||||
|
||||
void ClientWebGLContext::RawBufferSubData(GLenum target,
|
||||
WebGLsizeiptr dstByteOffset,
|
||||
const uint8_t* srcBytes,
|
||||
size_t srcLen, bool unsynchronized) {
|
||||
const FuncScope funcScope(*this, "bufferSubData");
|
||||
|
||||
Run<RPROC(BufferSubData)>(target, dstByteOffset,
|
||||
RawBuffer<>({srcBytes, srcLen}), unsynchronized);
|
||||
}
|
||||
|
||||
void ClientWebGLContext::BufferSubData(GLenum target,
|
||||
WebGLsizeiptr dstByteOffset,
|
||||
const dom::ArrayBuffer& src) {
|
||||
@@ -4554,6 +4573,38 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget,
|
||||
}
|
||||
}
|
||||
|
||||
void ClientWebGLContext::RawTexImage(uint32_t level, GLenum respecFormat,
|
||||
uvec3 offset, const webgl::PackingInfo& pi,
|
||||
webgl::TexUnpackBlobDesc&& desc) const {
|
||||
const FuncScope funcScope(*this, "tex(Sub)Image[23]D");
|
||||
if (IsContextLost()) return;
|
||||
if (desc.sd) {
|
||||
// Shmems are stored in Buffer surface descriptors. We need to ensure first
|
||||
// that all queued commands are flushed and then send the Shmem over IPDL.
|
||||
const auto& sd = *(desc.sd);
|
||||
if (sd.type() == layers::SurfaceDescriptor::TSurfaceDescriptorBuffer &&
|
||||
sd.get_SurfaceDescriptorBuffer().data().type() ==
|
||||
layers::MemoryOrShmem::TShmem) {
|
||||
const auto& inProcess = mNotLost->inProcess;
|
||||
if (inProcess) {
|
||||
inProcess->TexImage(level, respecFormat, offset, pi, desc);
|
||||
} else {
|
||||
const auto& child = mNotLost->outOfProcess;
|
||||
child->FlushPendingCmds();
|
||||
(void)child->SendTexImage(level, respecFormat, offset, pi,
|
||||
std::move(desc));
|
||||
}
|
||||
} else {
|
||||
NS_WARNING(
|
||||
"RawTexImage with SurfaceDescriptor only supports "
|
||||
"SurfaceDescriptorBuffer with Shmem");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Run<RPROC(TexImage)>(level, respecFormat, offset, pi, desc);
|
||||
}
|
||||
|
||||
// -
|
||||
|
||||
void ClientWebGLContext::CompressedTexImage(bool sub, uint8_t funcDims,
|
||||
@@ -5156,6 +5207,30 @@ bool ClientWebGLContext::DoReadPixels(const webgl::ReadPixelsDesc& desc,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ClientWebGLContext::DoReadPixels(const webgl::ReadPixelsDesc& desc,
|
||||
const mozilla::ipc::Shmem& shmem) const {
|
||||
const auto notLost =
|
||||
mNotLost; // Hold a strong-ref to prevent LoseContext=>UAF.
|
||||
if (!notLost) return false;
|
||||
const auto& inProcess = notLost->inProcess;
|
||||
if (inProcess) {
|
||||
const auto& shmemBytes = shmem.Range<uint8_t>();
|
||||
inProcess->ReadPixelsInto(desc, shmemBytes);
|
||||
return true;
|
||||
}
|
||||
const auto& child = notLost->outOfProcess;
|
||||
child->FlushPendingCmds();
|
||||
webgl::ReadPixelsResultIpc res = {};
|
||||
// We assume the input is an unsafe shmem which won't be consumed by this
|
||||
// request. Since SendReadPixels expects a Shmem rvalue, we must create a copy
|
||||
// to provide it that can be consumed instead of the original descriptor.
|
||||
mozilla::ipc::Shmem dest = shmem;
|
||||
if (!child->SendReadPixels(desc, dest, &res)) {
|
||||
res = {};
|
||||
}
|
||||
return res.byteStride > 0;
|
||||
}
|
||||
|
||||
bool ClientWebGLContext::ReadPixels_SharedPrecheck(
|
||||
dom::CallerType aCallerType, ErrorResult& out_error) const {
|
||||
if (IsContextLost()) return false;
|
||||
|
||||
Reference in New Issue
Block a user