Commit 55b03d0e by Frank Henigman Committed by Commit Bot

Fix ClearTest.RGB8WithMaskFramebuffer.

Clear all channels to known state before clearing with one masked, so we know what to expect in the masked one. BUG=angleproject:2674 Change-Id: Icbe58615c68e2b282a27d8f29c2f2a48fb8b1c3e Reviewed-on: https://chromium-review.googlesource.com/1212822 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent d84b6737
......@@ -190,12 +190,6 @@ TEST_P(ClearTest, ChangeFramebufferAttachmentFromRGBAtoRGB)
// Test clearing a RGB8 Framebuffer with a color mask.
TEST_P(ClearTest, RGB8WithMaskFramebuffer)
{
// TODO(fjhenigman): Diagnose and fix http://anglebug.com/2681
ANGLE_SKIP_TEST_IF(IsOzone() && IsOpenGLES());
// TODO(lucferron): Figure out why this test fails on OSX / OpenGL.
// http://anglebug.com/2674
ANGLE_SKIP_TEST_IF(IsOSX() && IsDesktopOpenGL());
glBindFramebuffer(GL_FRAMEBUFFER, mFBOs[0]);
GLTexture texture;
......@@ -205,14 +199,21 @@ TEST_P(ClearTest, RGB8WithMaskFramebuffer)
GL_UNSIGNED_BYTE, nullptr);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
glColorMask(GL_TRUE, GL_TRUE, GL_FALSE, GL_TRUE);
glClearColor(0.2f, 0.4f, 0.6f, 0.8f);
glClear(GL_COLOR_BUFFER_BIT);
// Since there's no alpha, we expect to get 255 back instead of the clear value (204).
EXPECT_PIXEL_NEAR(0, 0, 51, 102, 153, 255, 1.0);
// alpha shouldn't really be taken into account and we should find 255 as a result since we
// are writing to a RGB8 texture. Also, the
glClearColor(0.5f, 0.5f, 0.5f, 0.2f);
glColorMask(GL_TRUE, GL_TRUE, GL_FALSE, GL_TRUE);
glClearColor(0.1f, 0.3f, 0.5f, 0.7f);
glClear(GL_COLOR_BUFFER_BIT);
EXPECT_PIXEL_NEAR(0, 0, 128, 128, 0, 255, 1.0);
// The blue channel was masked so its value should be unchanged.
EXPECT_PIXEL_NEAR(0, 0, 26, 77, 153, 255, 1.0);
// Restore default.
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}
TEST_P(ClearTest, ClearIssue)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment