Bug 972164 - Fix readPixels to generate INV_FB_OP on incomplete FB before INV_OP. - r=kamidphish

This commit is contained in:
Jeff Gilbert 2014-02-28 18:51:43 -08:00
Родитель 882e78657d
Коммит ca5d893fe6
1 изменённых файлов: 4 добавлений и 4 удалений

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

@ -2319,15 +2319,15 @@ WebGLContext::ReadPixels(GLint x, GLint y, GLsizei width,
MakeContextCurrent();
if (mBoundFramebuffer) {
// prevent readback of arbitrary video memory through uninitialized renderbuffers!
if (!mBoundFramebuffer->CheckAndInitializeAttachments())
return ErrorInvalidFramebufferOperation("readPixels: incomplete framebuffer");
GLenum readPlaneBits = LOCAL_GL_COLOR_BUFFER_BIT;
if (!mBoundFramebuffer->HasCompletePlanes(readPlaneBits)) {
return ErrorInvalidOperation("readPixels: Read source attachment doesn't have the"
" correct color/depth/stencil type.");
}
// prevent readback of arbitrary video memory through uninitialized renderbuffers!
if (!mBoundFramebuffer->CheckAndInitializeAttachments())
return ErrorInvalidFramebufferOperation("readPixels: incomplete framebuffer");
}
// Now that the errors are out of the way, on to actually reading