Commit cbd14085 by Frank Henigman Committed by Commit Bot

Test CopyTex(Sub)Image on default framebuffer.

Add end2end tests that attempt CopyTexImage2D and CopyTexSubImage2D from the default framebuffer. BUG=angleproject:2027 Change-Id: Ic16527a0665317fe7d08d8204d1bd3f6309b0343 Reviewed-on: https://chromium-review.googlesource.com/494266 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 82830ede
......@@ -5,6 +5,7 @@
//
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
namespace angle
{
......@@ -298,6 +299,28 @@ TEST_P(CopyTexImageTest, SubImageRGBToL)
verifyResults(tex, expected1, 7, 7);
}
// Read default framebuffer with glCopyTexImage2D().
TEST_P(CopyTexImageTest, DefaultFramebuffer)
{
const GLint w = getWindowWidth(), h = getWindowHeight();
GLTexture tex;
glBindTexture(GL_TEXTURE_2D, tex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, w, h, 0);
EXPECT_GL_NO_ERROR();
}
// Read default framebuffer with glCopyTexSubImage2D().
TEST_P(CopyTexImageTest, SubDefaultFramebuffer)
{
const GLint w = getWindowWidth(), h = getWindowHeight();
GLTexture tex;
glBindTexture(GL_TEXTURE_2D, tex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, w, h);
EXPECT_GL_NO_ERROR();
}
// specialization of CopyTexImageTest is added so that some tests can be explicitly run with an ES3
// context
class CopyTexImageTestES3 : public CopyTexImageTest
......
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