Bug 1142975 - Check for Present()-caused context loss. - r=kamidphish

This commit is contained in:
Jeff Gilbert 2015-03-16 16:33:44 -07:00
Родитель 14c8830726
Коммит 30520fb49b
1 изменённых файлов: 7 добавлений и 0 удалений

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

@ -749,6 +749,8 @@ bool
WebGLContext::ResizeBackbuffer(uint32_t requestedWidth,
uint32_t requestedHeight)
{
MOZ_ASSERT(!IsContextLost());
uint32_t width = requestedWidth;
uint32_t height = requestedHeight;
@ -827,6 +829,11 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
// If we've already drawn, we should commit the current buffer.
PresentScreenBuffer();
if (IsContextLost()) {
GenerateWarning("WebGL context was lost due to swap failure.");
return NS_OK;
}
// ResizeOffscreen scraps the current prod buffer before making a new one.
if (!ResizeBackbuffer(width, height)) {
GenerateWarning("WebGL context failed to resize.");