Bug 1898238 - Don't call TexTypeForWebgl when initializing offscreen canvas. r=aosmond,jgilbert

This is only used if the OffscreenCanvas has a webgl context, in which
case it forwards the tex type to WebGLContext::PresentFrontBuffer(). A
later patch in this series will make TexTypeForWebgl() return a
different value depending on whether the webgl context is in-process
or remote, which is something that cannot be known when the
OffscreenCanvas is initialized. This patch therefore removes the field
from OffscreenCanvas and makes WebGLContext::PresentFrontBuffer() call
TexTypeForWebgl() itself.

Differential Revision: https://phabricator.services.mozilla.com/D211289
This commit is contained in:
Jamie Nicol
2024-07-22 20:23:37 +00:00
parent 682cb5dff9
commit 9526c88d05
8 changed files with 18 additions and 29 deletions

View File

@@ -587,8 +587,9 @@ Maybe<layers::SurfaceDescriptor> ClientWebGLContext::GetFrontBuffer(
}
Maybe<layers::SurfaceDescriptor> ClientWebGLContext::PresentFrontBuffer(
WebGLFramebufferJS* const fb, const layers::TextureType type, bool webvr) {
Present(fb, type, webvr);
WebGLFramebufferJS* const fb, bool webvr) {
const auto texType = GetTexTypeForSwapChain();
Present(fb, texType, webvr);
return GetFrontBuffer(fb, webvr);
}