IsGL_REDSupportedOnFBOs: return true only if FBO is complete

In general the framebuffer has to be complete to claim
supporting RED on FBO.

If textureId is invalid glFramebufferTexture2DEXT returns
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT.
So before this patch, IsGL_REDSupportedOnFBOs would have
returned true.

This leads to green frames when playing video.

This CL does fix bug 545904 but it is an indirect consequence.

We still need a new gpu driver bug workaround because this
CL does not avoid the DCHECK(glGetError() == GL_NO_ERROR);
at the end of IsGL_REDSupportedOnFBOs. Indeed the error is
set from the glTexImage2D call and glFramebufferTexture2DEXT
does not reset this gl error.

BUG=545904

R=bajones@chromium.org, hendrikw@chromium.org, kbr@chromium.org, zmo@chromium.org

TEST= --use-gl=egl on Mesa drivers

Review URL: https://codereview.chromium.org/1465223010

Cr-Commit-Position: refs/heads/master@{#362996}
1 file changed