зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1142975 - Check for Present()-caused context loss. - r=kamidphish
This commit is contained in:
Родитель
14c8830726
Коммит
30520fb49b
|
@ -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.");
|
||||
|
|
Загрузка…
Ссылка в новой задаче