Bug 1621523 - WebGL: Don't Present on no-op Resize. r=lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D66827

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jeff Gilbert 2020-03-14 00:33:04 +00:00
Родитель 53e6bfdbf2
Коммит 75333bbd2c
1 изменённых файлов: 11 добавлений и 7 удалений

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

@ -567,13 +567,17 @@ void WebGLContext::Resize(uvec2 requestedSize) {
requestedSize.y = 1;
}
// If we've already drawn, we should commit the current buffer.
PresentScreenBuffer();
if (IsContextLost()) {
GenerateWarning("WebGL context was lost due to swap failure.");
return;
}
// WebGL 1 spec:
// WebGL presents its drawing buffer to the HTML page compositor immediately
// before a compositing operation, but only if at least one of the following
// has occurred since the previous compositing operation:
//
// * Context creation
// * Canvas resize
// * clear, drawArrays, or drawElements has been called while the drawing
// buffer is the currently bound framebuffer
mShouldPresent = true;
if (requestedSize == mRequestedSize) return;
// Kill our current default fb(s), for later lazy allocation.
mRequestedSize = requestedSize;