Bug 1779410 - Ensure SwapChainPresenter destructor is called before we access the front buffer. r=aosmond

Differential Revision: https://phabricator.services.mozilla.com/D151732
This commit is contained in:
Lee Salzman 2022-07-13 17:27:03 +00:00
Родитель 41d7ccc557
Коммит 911d479aa2
1 изменённых файлов: 9 добавлений и 9 удалений

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

@ -1058,6 +1058,7 @@ void WebGLContext::CopyToSwapChain(WebGLFramebuffer* const srcFb,
return; return;
} }
{
// ColorSpace will need to be part of SwapChainOptions for DTWebgl. // ColorSpace will need to be part of SwapChainOptions for DTWebgl.
const auto colorSpace = ToColorSpace2(mOptions); const auto colorSpace = ToColorSpace2(mOptions);
auto presenter = srcFb->mSwapChain.Acquire(size, colorSpace); auto presenter = srcFb->mSwapChain.Acquire(size, colorSpace);
@ -1067,7 +1068,6 @@ void WebGLContext::CopyToSwapChain(WebGLFramebuffer* const srcFb,
return; return;
} }
{
const ScopedFBRebinder saveFB(this); const ScopedFBRebinder saveFB(this);
const auto destFb = presenter->Fb(); const auto destFb = presenter->Fb();