Bug 900020 - Renew the surface when we hit an incomplete default framebuffer in the compositor - r=nrc

This commit is contained in:
Benoit Jacob 2013-09-24 07:54:07 -04:00
Родитель 039861bb02
Коммит fa992cb104
1 изменённых файлов: 13 добавлений и 4 удалений

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

@ -34,10 +34,19 @@ CompositingRenderTargetOGL::BindRenderTarget()
mGL->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, mFBO);
GLenum result = mGL->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
if (result != LOCAL_GL_FRAMEBUFFER_COMPLETE) {
nsAutoCString msg;
msg.AppendPrintf("Framebuffer not complete -- error 0x%x, aFBOTextureTarget 0x%x, aRect.width %d, aRect.height %d",
result, mInitParams.mFBOTextureTarget, mInitParams.mSize.width, mInitParams.mSize.height);
NS_WARNING(msg.get());
// The main framebuffer (0) of non-offscreen contexts
// might be backed by a EGLSurface that needs to be renewed.
if (mFBO == 0 && !mGL->IsOffscreen()) {
mGL->RenewSurface();
result = mGL->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
}
if (result != LOCAL_GL_FRAMEBUFFER_COMPLETE) {
NS_WARNING("Framebuffer not complete -- CheckFramebufferStatus returned 0x%x, "
"GLContext=%p, IsOffscreen()=%d, mFBO=%d, aFBOTextureTarget=0x%x, "
"aRect.width=%d, aRect.height=%d",
result, mGL, mGL->IsOffscreen(), mFBO, mInitParams.mFBOTextureTarget,
mInitParams.mSize.width, mInitParams.mSize.height);
}
}
mCompositor->PrepareViewport(mInitParams.mSize, mTransform);