Bug 1829026 - Remove unused ClientWebGLContext local extensions. r=jgilbert,aosmond

DrawTargetWebgl is transitioning away from using ClientWebGLContext, so
local extensions that were added to support that use-case are no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D194346
This commit is contained in:
Lee Salzman 2023-12-05 09:37:01 +00:00
Родитель e9d09d91e9
Коммит c14ed2a57d
2 изменённых файлов: 0 добавлений и 91 удалений

Просмотреть файл

@ -3494,27 +3494,8 @@ 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) {
@ -4547,38 +4528,6 @@ 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,
@ -5181,30 +5130,6 @@ 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;

Просмотреть файл

@ -41,10 +41,6 @@ class OwningHTMLCanvasElementOrOffscreenCanvas;
class WebGLChild;
} // namespace dom
namespace gfx {
class DrawTargetWebgl;
}
namespace webgl {
class AvailabilityRunnable;
class TexUnpackBlob;
@ -753,7 +749,6 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal,
friend class webgl::ObjectJS;
friend class webgl::ProgramKeepAlive;
friend class webgl::ShaderKeepAlive;
friend class gfx::DrawTargetWebgl;
// ----------------------------- Lifetime and DOM ---------------------------
public:
@ -1093,8 +1088,6 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal,
RefPtr<gfx::DataSourceSurface> BackBufferSnapshot();
[[nodiscard]] bool DoReadPixels(const webgl::ReadPixelsDesc&,
Range<uint8_t>) const;
[[nodiscard]] bool DoReadPixels(const webgl::ReadPixelsDesc&,
const mozilla::ipc::Shmem&) const;
uvec2 DrawingBufferSize();
// -
@ -1499,12 +1492,6 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal,
GLenum usage, GLuint srcElemOffset = 0,
GLuint srcElemCountOverride = 0);
void RawBufferData(GLenum target, const uint8_t* srcBytes, size_t srcLen,
GLenum usage);
void RawBufferSubData(GLenum target, WebGLsizeiptr dstByteOffset,
const uint8_t* srcBytes, size_t srcLen,
bool unsynchronized = false);
void BufferSubData(GLenum target, WebGLsizeiptr dstByteOffset,
const dom::ArrayBufferView& src, GLuint srcElemOffset = 0,
GLuint srcElemCountOverride = 0);
@ -1622,9 +1609,6 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal,
GLenum internalFormat, const ivec3& size) const;
// Primitive tex upload functions
void RawTexImage(uint32_t level, GLenum respecFormat, uvec3 offset,
const webgl::PackingInfo& pi,
webgl::TexUnpackBlobDesc&&) const;
void TexImage(uint8_t funcDims, GLenum target, GLint level,
GLenum respecFormat, const ivec3& offset,
const Maybe<ivec3>& size, GLint border,