Bug 1382104 - Set viewport and colormask for draw-blit. - r=daoshengmu
MozReview-Commit-ID: HdIclDeh9ql
--- a/gfx/gl/GLBlitHelper.cpp
+++ b/gfx/gl/GLBlitHelper.cpp
@@ -895,29 +895,31 @@ GLBlitHelper::DrawBlitTextureToFramebuff
default:
MOZ_CRASH("GFX: Fatal Error: Bad `srcTarget`.");
break;
}
ScopedGLDrawState autoStates(mGL);
const ScopedBindFramebuffer bindFB(mGL, destFB);
+ mGL->fColorMask(1, 1, 1, 1);
+
// Does destructive things to (only!) what we just saved above.
bool good = UseTexQuadProgram(type, srcSize);
if (!good) {
// We're up against the wall, so bail.
MOZ_DIAGNOSTIC_ASSERT(false,
"Error: Failed to prepare to blit texture->framebuffer.\n");
mGL->fScissor(0, 0, destSize.width, destSize.height);
- mGL->fColorMask(1, 1, 1, 1);
mGL->fClear(LOCAL_GL_COLOR_BUFFER_BIT);
return;
}
const ScopedBindTexture bindTex(mGL, srcTex, srcTarget);
+ mGL->fViewport(0, 0, destSize.width, destSize.height);
mGL->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4);
}
void
GLBlitHelper::BlitFramebufferToTexture(GLuint srcFB, GLuint destTex,
const gfx::IntSize& srcSize,
const gfx::IntSize& destSize,
GLenum destTarget)