Bug 1312865 - ClearBuffer and similar funcs should mirror Clear's behavior. - r=daoshengmu

MozReview-Commit-ID: 4Gm5aNZ1PXX
This commit is contained in:
Jeff Gilbert
2016-12-20 23:31:22 -08:00
parent 89f5d897bf
commit cb6ca1db8c
8 changed files with 62 additions and 38 deletions

View File

@@ -32,24 +32,14 @@ WebGLContext::Clear(GLbitfield mask)
GenerateWarning("Calling gl.clear() with RASTERIZER_DISCARD enabled has no effects.");
}
if (mBoundDrawFramebuffer) {
if (!mBoundDrawFramebuffer->ValidateAndInitAttachments(funcName))
return;
gl->fClear(mask);
return;
} else {
ClearBackbufferIfNeeded();
}
// Ok, we're clearing the default framebuffer/screen.
if (mBoundDrawFramebuffer &&
!mBoundDrawFramebuffer->ValidateAndInitAttachments(funcName))
{
ScopedMaskWorkaround autoMask(*this);
gl->fClear(mask);
return;
}
Invalidate();
mShouldPresent = true;
ScopedDrawCallWrapper wrapper(*this);
gl->fClear(mask);
}
static GLfloat