| Index: gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc
|
| diff --git a/gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc b/gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc
|
| index 45e14deb060a63f2db54a63519f0a86ec8cb5141..02626e56937af3ad1db7654efcbe67a84d065789 100644
|
| --- a/gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc
|
| +++ b/gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc
|
| @@ -328,7 +328,7 @@ class GLCopyTextureCHROMIUMTest
|
| // glCopySubTextureCHROMIUM to support copying from level > 0 of source
|
| // texture to level > 0 of dest texture.
|
| if (copy_type == TexImage) {
|
| - glCopyTextureCHROMIUM(textures_[0], textures_[1],
|
| + glCopyTextureCHROMIUM(textures_[0], 0, textures_[1], 0,
|
| dest_format_type.internal_format,
|
| dest_format_type.type, false, false, false);
|
| } else {
|
| @@ -337,8 +337,8 @@ class GLCopyTextureCHROMIUMTest
|
| height_, 0, dest_format_type.format, dest_format_type.type,
|
| nullptr);
|
|
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0, 0, width_,
|
| - height_, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 0, 0, 0, 0,
|
| + width_, height_, false, false, false);
|
| }
|
| EXPECT_TRUE(glGetError() == GL_NO_ERROR);
|
|
|
| @@ -455,15 +455,15 @@ TEST_P(GLCopyTextureCHROMIUMTest, Basic) {
|
| pixels);
|
|
|
| if (copy_type == TexImage) {
|
| - glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA,
|
| + glCopyTextureCHROMIUM(textures_[0], 0, textures_[1], 0, GL_RGBA,
|
| GL_UNSIGNED_BYTE, false, false, false);
|
| } else {
|
| glBindTexture(GL_TEXTURE_2D, textures_[1]);
|
| glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
| nullptr);
|
|
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0,
|
| - 0, 1, 1, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 0, 0, 0, 0, 1, 1,
|
| + false, false, false);
|
| }
|
| EXPECT_TRUE(glGetError() == GL_NO_ERROR);
|
|
|
| @@ -595,13 +595,13 @@ TEST_P(GLCopyTextureCHROMIUMTest, ImmutableTexture) {
|
| EXPECT_TRUE(glGetError() == GL_NO_ERROR);
|
|
|
| if (copy_type == TexImage) {
|
| - glCopyTextureCHROMIUM(textures_[0], textures_[1],
|
| + glCopyTextureCHROMIUM(textures_[0], 0, textures_[1], 0,
|
| ExtractFormatFrom(dest_internal_format),
|
| GL_UNSIGNED_BYTE, false, false, false);
|
| EXPECT_TRUE(glGetError() == GL_INVALID_OPERATION);
|
| } else {
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0, 0, 1, 1,
|
| - false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 0, 0, 0, 0,
|
| + 1, 1, false, false, false);
|
| EXPECT_TRUE(glGetError() == GL_NO_ERROR);
|
|
|
| // Check the FB is still bound.
|
| @@ -639,17 +639,17 @@ TEST_P(GLCopyTextureCHROMIUMTest, InternalFormat) {
|
| EXPECT_TRUE(GL_NO_ERROR == glGetError());
|
|
|
| if (copy_type == TexImage) {
|
| - glCopyTextureCHROMIUM(textures_[0], textures_[1],
|
| - dest_formats[dest_index], GL_UNSIGNED_BYTE,
|
| - false, false, false);
|
| + glCopyTextureCHROMIUM(textures_[0], 0, textures_[1], 0,
|
| + dest_formats[dest_index], GL_UNSIGNED_BYTE, false,
|
| + false, false);
|
| } else {
|
| glBindTexture(GL_TEXTURE_2D, textures_[1]);
|
| glTexImage2D(GL_TEXTURE_2D, 0, dest_formats[dest_index], 1, 1, 0,
|
| dest_formats[dest_index], GL_UNSIGNED_BYTE, nullptr);
|
| EXPECT_TRUE(GL_NO_ERROR == glGetError());
|
|
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0,
|
| - 0, 0, 0, 1, 1, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 0, 0, 0, 0,
|
| + 1, 1, false, false, false);
|
| }
|
|
|
| EXPECT_TRUE(GL_NO_ERROR == glGetError()) << "src_index:" << src_index
|
| @@ -673,7 +673,7 @@ TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatNotSupported) {
|
| for (size_t dest_index = 0; dest_index < arraysize(unsupported_dest_formats);
|
| dest_index++) {
|
| if (copy_type == TexImage) {
|
| - glCopyTextureCHROMIUM(textures_[0], textures_[1],
|
| + glCopyTextureCHROMIUM(textures_[0], 0, textures_[1], 0,
|
| unsupported_dest_formats[dest_index],
|
| GL_UNSIGNED_BYTE, false, false, false);
|
| } else {
|
| @@ -681,8 +681,8 @@ TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatNotSupported) {
|
| glTexImage2D(GL_TEXTURE_2D, 0, unsupported_dest_formats[dest_index], 1, 1,
|
| 0, unsupported_dest_formats[dest_index], GL_UNSIGNED_BYTE,
|
| nullptr);
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0,
|
| - 0, 0, 1, 1, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 0, 0, 0, 0, 1,
|
| + 1, false, false, false);
|
| }
|
| EXPECT_TRUE(GL_INVALID_OPERATION == glGetError())
|
| << "dest_index:" << dest_index;
|
| @@ -707,9 +707,10 @@ TEST_F(GLCopyTextureCHROMIUMTest, InternalFormatTypeCombinationNotSupported) {
|
| };
|
| for (size_t dest_index = 0; dest_index < arraysize(unsupported_format_types);
|
| dest_index++) {
|
| - glCopyTextureCHROMIUM(
|
| - textures_[0], textures_[1], unsupported_format_types[dest_index].format,
|
| - unsupported_format_types[dest_index].type, false, false, false);
|
| + glCopyTextureCHROMIUM(textures_[0], 0, textures_[1], 0,
|
| + unsupported_format_types[dest_index].format,
|
| + unsupported_format_types[dest_index].type, false,
|
| + false, false);
|
| EXPECT_TRUE(GL_INVALID_OPERATION == glGetError())
|
| << "dest_index:" << dest_index;
|
| }
|
| @@ -796,7 +797,7 @@ TEST_F(GLCopyTextureCHROMIUMTest, RedefineDestinationTexture) {
|
|
|
| // If the dest texture has different properties, glCopyTextureCHROMIUM()
|
| // redefines them.
|
| - glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA,
|
| + glCopyTextureCHROMIUM(textures_[0], 0, textures_[1], 0, GL_RGBA,
|
| GL_UNSIGNED_BYTE, false, false, false);
|
| EXPECT_TRUE(GL_NO_ERROR == glGetError());
|
|
|
| @@ -869,11 +870,11 @@ TEST_P(GLCopyTextureCHROMIUMTest, BasicStatePreservation) {
|
| glActiveTexture(GL_TEXTURE1 + x);
|
|
|
| if (copy_type == TexImage) {
|
| - glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA,
|
| + glCopyTextureCHROMIUM(textures_[0], 0, textures_[1], 0, GL_RGBA,
|
| GL_UNSIGNED_BYTE, false, false, false);
|
| } else {
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0,
|
| - 0, 0, 1, 1, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 0, 0, 0, 0, 1,
|
| + 1, false, false, false);
|
| }
|
| EXPECT_TRUE(GL_NO_ERROR == glGetError());
|
|
|
| @@ -932,11 +933,11 @@ TEST_P(GLCopyTextureCHROMIUMTest, TextureStatePreserved) {
|
| glBindTexture(GL_TEXTURE_2D, texture_ids[1]);
|
|
|
| if (copy_type == TexImage) {
|
| - glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA,
|
| + glCopyTextureCHROMIUM(textures_[0], 0, textures_[1], 0, GL_RGBA,
|
| GL_UNSIGNED_BYTE, false, false, false);
|
| } else {
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0,
|
| - 0, 1, 1, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 0, 0, 0, 0, 1, 1,
|
| + false, false, false);
|
| }
|
| EXPECT_TRUE(GL_NO_ERROR == glGetError());
|
|
|
| @@ -1007,11 +1008,11 @@ TEST_P(GLCopyTextureCHROMIUMTest, FBOStatePreserved) {
|
| GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_color, nullptr);
|
|
|
| if (copy_type == TexImage) {
|
| - glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA,
|
| + glCopyTextureCHROMIUM(textures_[0], 0, textures_[1], 0, GL_RGBA,
|
| GL_UNSIGNED_BYTE, false, false, false);
|
| } else {
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0,
|
| - 0, 1, 1, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 0, 0, 0, 0, 1, 1,
|
| + false, false, false);
|
| }
|
| EXPECT_TRUE(GL_NO_ERROR == glGetError());
|
|
|
| @@ -1122,14 +1123,14 @@ TEST_P(GLCopyTextureCHROMIUMTest, ProgramStatePreservation) {
|
| glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
| pixels);
|
| if (copy_type == TexImage) {
|
| - glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA,
|
| + glCopyTextureCHROMIUM(textures_[0], 0, textures_[1], 0, GL_RGBA,
|
| GL_UNSIGNED_BYTE, false, false, false);
|
| } else {
|
| glBindTexture(GL_TEXTURE_2D, textures_[1]);
|
| glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
| nullptr);
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0,
|
| - 0, 1, 1, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 0, 0, 0, 0, 1, 1,
|
| + false, false, false);
|
| }
|
|
|
| // test using program after
|
| @@ -1158,14 +1159,14 @@ TEST_P(GLCopyTextureCHROMIUMTest, UninitializedSource) {
|
| GL_UNSIGNED_BYTE, nullptr);
|
|
|
| if (copy_type == TexImage) {
|
| - glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA,
|
| + glCopyTextureCHROMIUM(textures_[0], 0, textures_[1], 0, GL_RGBA,
|
| GL_UNSIGNED_BYTE, false, false, false);
|
| } else {
|
| glBindTexture(GL_TEXTURE_2D, textures_[1]);
|
| glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, kWidth, kHeight, 0, GL_RGBA,
|
| GL_UNSIGNED_BYTE, nullptr);
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0,
|
| - 0, kWidth, kHeight, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 0, 0, 0, 0,
|
| + kWidth, kHeight, false, false, false);
|
| }
|
| EXPECT_TRUE(GL_NO_ERROR == glGetError());
|
|
|
| @@ -1196,28 +1197,28 @@ TEST_F(GLCopyTextureCHROMIUMTest, CopySubTextureDimension) {
|
| glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 3, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
| nullptr);
|
|
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 1, 1, 0,
|
| - 0, 1, 1, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 1, 1, 0, 0, 1, 1,
|
| + false, false, false);
|
| EXPECT_TRUE(GL_NO_ERROR == glGetError());
|
|
|
| // xoffset < 0
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], -1, 1, 0,
|
| - 0, 1, 1, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, -1, 1, 0, 0, 1, 1,
|
| + false, false, false);
|
| EXPECT_TRUE(glGetError() == GL_INVALID_VALUE);
|
|
|
| // x < 0
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 1, 1, -1,
|
| - 0, 1, 1, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 1, 1, -1, 0, 1, 1,
|
| + false, false, false);
|
| EXPECT_TRUE(glGetError() == GL_INVALID_VALUE);
|
|
|
| // xoffset + width > dest_width
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 2, 2, 0,
|
| - 0, 2, 2, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 2, 2, 0, 0, 2, 2,
|
| + false, false, false);
|
| EXPECT_TRUE(glGetError() == GL_INVALID_VALUE);
|
|
|
| // x + width > source_width
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 1,
|
| - 1, 2, 2, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 0, 0, 1, 1, 2, 2,
|
| + false, false, false);
|
| EXPECT_TRUE(glGetError() == GL_INVALID_VALUE);
|
|
|
| glDeleteTextures(2, textures_);
|
| @@ -1234,19 +1235,19 @@ TEST_F(GLCopyTextureCHROMIUMTest, CopyTextureInvalidTextureIds) {
|
| glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 3, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
| nullptr);
|
|
|
| - glCopyTextureCHROMIUM(textures_[0], 99993, GL_RGBA,
|
| - GL_UNSIGNED_BYTE, false, false, false);
|
| + glCopyTextureCHROMIUM(textures_[0], 0, 99993, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
| + false, false, false);
|
| EXPECT_TRUE(GL_INVALID_VALUE == glGetError());
|
|
|
| - glCopyTextureCHROMIUM(99994, textures_[1], GL_RGBA,
|
| - GL_UNSIGNED_BYTE, false, false, false);
|
| + glCopyTextureCHROMIUM(99994, 0, textures_[1], 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
| + false, false, false);
|
| EXPECT_TRUE(GL_INVALID_VALUE == glGetError());
|
|
|
| - glCopyTextureCHROMIUM(99995, 99996, GL_RGBA, GL_UNSIGNED_BYTE,
|
| - false, false, false);
|
| + glCopyTextureCHROMIUM(99995, 0, 99996, 0, GL_RGBA, GL_UNSIGNED_BYTE, false,
|
| + false, false);
|
| EXPECT_TRUE(GL_INVALID_VALUE == glGetError());
|
|
|
| - glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA,
|
| + glCopyTextureCHROMIUM(textures_[0], 0, textures_[1], 0, GL_RGBA,
|
| GL_UNSIGNED_BYTE, false, false, false);
|
| EXPECT_TRUE(GL_NO_ERROR == glGetError());
|
|
|
| @@ -1264,20 +1265,20 @@ TEST_F(GLCopyTextureCHROMIUMTest, CopySubTextureInvalidTextureIds) {
|
| glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 3, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
| nullptr);
|
|
|
| - glCopySubTextureCHROMIUM(textures_[0], 99993, 1, 1, 0, 0, 1, 1,
|
| - false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, 99993, 0, 1, 1, 0, 0, 1, 1, false,
|
| + false, false);
|
| EXPECT_TRUE(GL_INVALID_VALUE == glGetError());
|
|
|
| - glCopySubTextureCHROMIUM(99994, textures_[1], 1, 1, 0, 0, 1, 1,
|
| - false, false, false);
|
| + glCopySubTextureCHROMIUM(99994, 0, textures_[1], 0, 1, 1, 0, 0, 1, 1, false,
|
| + false, false);
|
| EXPECT_TRUE(GL_INVALID_VALUE == glGetError());
|
|
|
| - glCopySubTextureCHROMIUM(99995, 99996, 1, 1, 0, 0, 1, 1, false,
|
| - false, false);
|
| + glCopySubTextureCHROMIUM(99995, 0, 99996, 0, 1, 1, 0, 0, 1, 1, false, false,
|
| + false);
|
| EXPECT_TRUE(GL_INVALID_VALUE == glGetError());
|
|
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 1, 1, 0,
|
| - 0, 1, 1, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 1, 1, 0, 0, 1, 1,
|
| + false, false, false);
|
| EXPECT_TRUE(GL_NO_ERROR == glGetError());
|
|
|
| glDeleteTextures(2, textures_);
|
| @@ -1298,14 +1299,14 @@ TEST_F(GLCopyTextureCHROMIUMTest, CopySubTextureOffset) {
|
| glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
| transparent_pixels);
|
|
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 1, 1, 0,
|
| - 0, 1, 1, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 1, 1, 0, 0, 1, 1,
|
| + false, false, false);
|
| EXPECT_TRUE(glGetError() == GL_NO_ERROR);
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 1, 0, 1,
|
| - 0, 1, 1, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 1, 0, 1, 0, 1, 1,
|
| + false, false, false);
|
| EXPECT_TRUE(glGetError() == GL_NO_ERROR);
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 1, 0,
|
| - 1, 1, 1, false, false, false);
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, 0, 1, 0, 1, 1, 1,
|
| + false, false, false);
|
| EXPECT_TRUE(glGetError() == GL_NO_ERROR);
|
|
|
| // Check the FB is still bound.
|
| @@ -1395,7 +1396,7 @@ TEST_F(GLCopyTextureCHROMIUMTest, CopyTextureBetweenTexture2DAndRectangleArb) {
|
| // Copy the subtexture x=[13,18) y=[6,9) to the destination.
|
| glClearColor(grey[0] / 255.f, grey[1] / 255.f, grey[2] / 255.f, 1.0);
|
| glClear(GL_COLOR_BUFFER_BIT);
|
| - glCopySubTextureCHROMIUM(textures_[0], textures_[1], copy_region_x,
|
| + glCopySubTextureCHROMIUM(textures_[0], 0, textures_[1], 0, copy_region_x,
|
| copy_region_y, 13, 6, copy_region_width,
|
| copy_region_height, false, false, false);
|
| EXPECT_TRUE(GL_NO_ERROR == glGetError());
|
|
|