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,16 +1058,16 @@ void WebGLContext::CopyToSwapChain(WebGLFramebuffer* const srcFb,
return; return;
} }
// ColorSpace will need to be part of SwapChainOptions for DTWebgl.
const auto colorSpace = ToColorSpace2(mOptions);
auto presenter = srcFb->mSwapChain.Acquire(size, colorSpace);
if (!presenter) {
GenerateWarning("Swap chain surface creation failed.");
LoseContext();
return;
}
{ {
// ColorSpace will need to be part of SwapChainOptions for DTWebgl.
const auto colorSpace = ToColorSpace2(mOptions);
auto presenter = srcFb->mSwapChain.Acquire(size, colorSpace);
if (!presenter) {
GenerateWarning("Swap chain surface creation failed.");
LoseContext();
return;
}
const ScopedFBRebinder saveFB(this); const ScopedFBRebinder saveFB(this);
const auto destFb = presenter->Fb(); const auto destFb = presenter->Fb();