src/third_party/angle/src/tests/gl_tests/BlitFramebufferANGLETest.cpp
// blit from system FBO to user-created framebuffer, with the scissor test enabled.
blit from system FBO to user-created framebuffer, with the scissor test enabled.
blit from system FBO to user - created framebuffer with the scissor test enabled .
TEST_P(BlitFramebufferANGLETest, ReverseScissoredBlit)
{
    ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_framebuffer_blit"));
    glBindFramebuffer(GL_FRAMEBUFFER, mOriginalFBO);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
    drawQuad(mCheckerProgram, essl1_shaders::PositionAttrib(), 0.8f);
    EXPECT_GL_NO_ERROR();
    glBindFramebuffer(GL_DRAW_FRAMEBUFFER_ANGLE, mUserFBO);
    glBindFramebuffer(GL_READ_FRAMEBUFFER_ANGLE, mOriginalFBO);
    glClearColor(1.0, 1.0, 1.0, 1.0);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
    glScissor(getWindowWidth() / 2, 0, getWindowWidth() / 2, getWindowHeight());
    glEnable(GL_SCISSOR_TEST);
    glBlitFramebufferANGLE(0, 0, getWindowWidth(), getWindowHeight(), 0, 0, getWindowWidth(),
                           getWindowHeight(), GL_COLOR_BUFFER_BIT, GL_NEAREST);
    EXPECT_GL_NO_ERROR();
    glDisable(GL_SCISSOR_TEST);
    glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO);
    EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, getWindowHeight() / 4, GLColor::white);
    EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, 3 * getWindowHeight() / 4, GLColor::white);
    EXPECT_PIXEL_COLOR_EQ(3 * getWindowWidth() / 4, getWindowHeight() / 4, GLColor::blue);
    EXPECT_PIXEL_COLOR_EQ(3 * getWindowWidth() / 4, 3 * getWindowHeight() / 4, GLColor::yellow);
}
TEST_P ( BlitFramebufferANGLETest , ReverseScissoredBlit ) { ANGLE_SKIP_TEST_IF ( ! IsGLExtensionEnabled ( " " ) ) ; glBindFramebuffer ( GL_FRAMEBUFFER , mOriginalFBO ) ; glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT ) ; drawQuad ( mCheckerProgram , essl1_shaders :: PositionAttrib ( ) , 0.8f ) ; EXPECT_GL_NO_ERROR ( ) ; glBindFramebuffer ( GL_DRAW_FRAMEBUFFER_ANGLE , mUserFBO ) ; glBindFramebuffer ( GL_READ_FRAMEBUFFER_ANGLE , mOriginalFBO ) ; glClearColor ( 1.0 , 1.0 , 1.0 , 1.0 ) ; glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT ) ; glScissor ( getWindowWidth ( ) / 2 , 0 , getWindowWidth ( ) / 2 , getWindowHeight ( ) ) ; glEnable ( GL_SCISSOR_TEST ) ; glBlitFramebufferANGLE ( 0 , 0 , getWindowWidth ( ) , getWindowHeight ( ) , 0 , 0 , getWindowWidth ( ) , getWindowHeight ( ) , GL_COLOR_BUFFER_BIT , GL_NEAREST ) ; EXPECT_GL_NO_ERROR ( ) ; glDisable ( GL_SCISSOR_TEST ) ; glBindFramebuffer ( GL_FRAMEBUFFER , mUserFBO ) ; EXPECT_PIXEL_COLOR_EQ ( getWindowWidth ( ) / 4 , getWindowHeight ( ) / 4 , GLColor :: white ) ; EXPECT_PIXEL_COLOR_EQ ( getWindowWidth ( ) / 4 , 3 * getWindowHeight ( ) / 4 , GLColor :: white ) ; EXPECT_PIXEL_COLOR_EQ ( 3 * getWindowWidth ( ) / 4 , getWindowHeight ( ) / 4 , GLColor :: blue ) ; EXPECT_PIXEL_COLOR_EQ ( 3 * getWindowWidth ( ) / 4 , 3 * getWindowHeight ( ) / 4 , GLColor :: yellow ) ; }
blit from system FBO to user-created framebuffer, with the scissor test enabled.
blit from system FBO to user - created framebuffer with the scissor test enabled .