Bug 1276096 - Forbid reads from backbuffer with readBuffer(NONE). - r=jrmuizel

This commit is contained in:
Jeff Gilbert 2016-05-26 18:07:52 -07:00
Родитель 3773a30362
Коммит 42afe56497
1 изменённых файлов: 8 добавлений и 0 удалений

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

@ -1882,6 +1882,14 @@ WebGLContext::ValidateCurFBForRead(const char* funcName,
GLenum* const out_mode) GLenum* const out_mode)
{ {
if (!mBoundReadFramebuffer) { if (!mBoundReadFramebuffer) {
const GLenum readBufferMode = gl->Screen()->GetReadBufferMode();
if (readBufferMode == LOCAL_GL_NONE) {
ErrorInvalidOperation("%s: Can't read from backbuffer when readBuffer mode is"
" NONE.",
funcName);
return false;
}
ClearBackbufferIfNeeded(); ClearBackbufferIfNeeded();
// FIXME - here we're assuming that the default framebuffer is backed by // FIXME - here we're assuming that the default framebuffer is backed by