diff options
| author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 16:13:58 +0000 |
|---|---|---|
| committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 16:13:58 +0000 |
| commit | 6b8cf1ad4ff0c7c145154d78e557eef666247a50 (patch) | |
| tree | 56b75e13699c5faf75ba687624dc2dc2ac12abf0 /gpu/command_buffer/client/gles2_implementation_unittest.cc | |
| parent | ab50f5225ec04327d77e9bf3fe0fbc66473c77ab (diff) | |
| download | chromium_src-6b8cf1ad4ff0c7c145154d78e557eef666247a50.zip chromium_src-6b8cf1ad4ff0c7c145154d78e557eef666247a50.tar.gz chromium_src-6b8cf1ad4ff0c7c145154d78e557eef666247a50.tar.bz2 | |
Various fixes for the OpenGL ES 2.0 conformance tests.
Was failing 268 of 1198
Now failing 266 of 1198
ugh! all those changes only fixed 2 tests :-(
TEST=some unit test and conformance tests.
BUG=none
Review URL: http://codereview.chromium.org/1942004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46572 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/client/gles2_implementation_unittest.cc')
| -rw-r--r-- | gpu/command_buffer/client/gles2_implementation_unittest.cc | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc index e43bf84..b73b889 100644 --- a/gpu/command_buffer/client/gles2_implementation_unittest.cc +++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc @@ -626,6 +626,8 @@ TEST_F(GLES2ImplementationTest, GetVertexAttrib) { EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); } +#endif // defined(GLES2_SUPPORT_CLIENT_SIDE_BUFFERS) + TEST_F(GLES2ImplementationTest, ReservedIds) { // Only the get error command should be issued. struct Cmds { @@ -650,8 +652,42 @@ TEST_F(GLES2ImplementationTest, ReservedIds) { EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); } -#endif // defined(GLES2_SUPPORT_CLIENT_SIDE_BUFFERS) +TEST_F(GLES2ImplementationTest, ReadPixels2Reads) { + struct Cmds { + ReadPixels read1; + cmd::SetToken set_token1; + ReadPixels read2; + cmd::SetToken set_token2; + }; + const GLint kBytesPerPixel = 4; + const GLint kWidth = + (kTransferBufferSize - GLES2Implementation::kStartingOffset) / + kBytesPerPixel; + const GLint kHeight = 2; + const GLenum kFormat = GL_RGBA; + const GLenum kType = GL_UNSIGNED_BYTE; + + int32 token = 1; + uint32 offset = GLES2Implementation::kStartingOffset; + Cmds expected; + expected.read1.Init(0, 0, kWidth, kHeight / 2, kFormat, kType, + kTransferBufferId, offset, + kTransferBufferId, 0); + expected.set_token1.Init(token++); + expected.read2.Init(0, kHeight / 2, kWidth, kHeight / 2, kFormat, kType, + kTransferBufferId, offset, + kTransferBufferId, 0); + expected.set_token2.Init(token++); + scoped_array<int8> buffer(new int8[kWidth * kHeight * kBytesPerPixel]); + EXPECT_CALL(*command_buffer_, OnFlush(_)) + .WillOnce(SetMemory(uint32(1))) + .WillOnce(SetMemory(uint32(1))) + .RetiresOnSaturation(); + + gl_->ReadPixels(0, 0, kWidth, kHeight, kFormat, kType, buffer.get()); + EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); +} } // namespace gles2 } // namespace gpu |
