| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 } | 124 } |
| 125 | 125 |
| 126 // Same as GenerateMipmapClearsUnclearedTexture, but with workaround | 126 // Same as GenerateMipmapClearsUnclearedTexture, but with workaround |
| 127 // |set_texture_filters_before_generating_mipmap|. | 127 // |set_texture_filters_before_generating_mipmap|. |
| 128 TEST_P(GLES2DecoderManualInitTest, SetTextureFiltersBeforeGenerateMipmap) { | 128 TEST_P(GLES2DecoderManualInitTest, SetTextureFiltersBeforeGenerateMipmap) { |
| 129 base::CommandLine command_line(0, NULL); | 129 base::CommandLine command_line(0, NULL); |
| 130 command_line.AppendSwitchASCII( | 130 command_line.AppendSwitchASCII( |
| 131 switches::kGpuDriverBugWorkarounds, | 131 switches::kGpuDriverBugWorkarounds, |
| 132 base::IntToString(gpu::SET_TEXTURE_FILTER_BEFORE_GENERATING_MIPMAP)); | 132 base::IntToString(gpu::SET_TEXTURE_FILTER_BEFORE_GENERATING_MIPMAP)); |
| 133 InitState init; | 133 InitState init; |
| 134 init.gl_version = "3.0"; | |
| 135 init.bind_generates_resource = true; | 134 init.bind_generates_resource = true; |
| 136 InitDecoderWithCommandLine(init, &command_line); | 135 InitDecoderWithCommandLine(init, &command_line); |
| 137 | 136 |
| 138 EXPECT_CALL(*gl_, GenerateMipmapEXT(_)).Times(0); | 137 EXPECT_CALL(*gl_, GenerateMipmapEXT(_)).Times(0); |
| 139 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 138 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 140 DoTexImage2D( | 139 DoTexImage2D( |
| 141 GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); | 140 GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); |
| 142 SetupClearTextureExpectations(kServiceTextureId, | 141 SetupClearTextureExpectations(kServiceTextureId, |
| 143 kServiceTextureId, | 142 kServiceTextureId, |
| 144 GL_TEXTURE_2D, | 143 GL_TEXTURE_2D, |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 CopyTexImage2D cmd; | 633 CopyTexImage2D cmd; |
| 635 cmd.Init(target, level, internal_format, 0, 0, width, height); | 634 cmd.Init(target, level, internal_format, 0, 0, width, height); |
| 636 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 635 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 637 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); | 636 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); |
| 638 EXPECT_FALSE(texture->GetLevelSize(GL_TEXTURE_2D, level, &width, &height)); | 637 EXPECT_FALSE(texture->GetLevelSize(GL_TEXTURE_2D, level, &width, &height)); |
| 639 } | 638 } |
| 640 | 639 |
| 641 TEST_P(GLES2DecoderManualInitTest, CompressedTexImage2DBucketBadBucket) { | 640 TEST_P(GLES2DecoderManualInitTest, CompressedTexImage2DBucketBadBucket) { |
| 642 InitState init; | 641 InitState init; |
| 643 init.extensions = "GL_EXT_texture_compression_s3tc"; | 642 init.extensions = "GL_EXT_texture_compression_s3tc"; |
| 644 init.gl_version = "3.0"; | |
| 645 init.bind_generates_resource = true; | 643 init.bind_generates_resource = true; |
| 646 InitDecoder(init); | 644 InitDecoder(init); |
| 647 | 645 |
| 648 const uint32 kBadBucketId = 123; | 646 const uint32 kBadBucketId = 123; |
| 649 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 647 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 650 CompressedTexImage2DBucket cmd; | 648 CompressedTexImage2DBucket cmd; |
| 651 cmd.Init(GL_TEXTURE_2D, | 649 cmd.Init(GL_TEXTURE_2D, |
| 652 0, | 650 0, |
| 653 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, | 651 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, |
| 654 4, | 652 4, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 672 struct S3TCTestData { | 670 struct S3TCTestData { |
| 673 GLenum format; | 671 GLenum format; |
| 674 size_t block_size; | 672 size_t block_size; |
| 675 }; | 673 }; |
| 676 | 674 |
| 677 } // anonymous namespace. | 675 } // anonymous namespace. |
| 678 | 676 |
| 679 TEST_P(GLES2DecoderManualInitTest, CompressedTexImage2DS3TC) { | 677 TEST_P(GLES2DecoderManualInitTest, CompressedTexImage2DS3TC) { |
| 680 InitState init; | 678 InitState init; |
| 681 init.extensions = "GL_EXT_texture_compression_s3tc"; | 679 init.extensions = "GL_EXT_texture_compression_s3tc"; |
| 682 init.gl_version = "3.0"; | |
| 683 init.bind_generates_resource = true; | 680 init.bind_generates_resource = true; |
| 684 InitDecoder(init); | 681 InitDecoder(init); |
| 685 const uint32 kBucketId = 123; | 682 const uint32 kBucketId = 123; |
| 686 CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId); | 683 CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId); |
| 687 ASSERT_TRUE(bucket != NULL); | 684 ASSERT_TRUE(bucket != NULL); |
| 688 | 685 |
| 689 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 686 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 690 | 687 |
| 691 static const S3TCTestData test_data[] = { | 688 static const S3TCTestData test_data[] = { |
| 692 { | 689 { |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 kSharedMemoryId, | 1080 kSharedMemoryId, |
| 1084 kSharedMemoryOffset); | 1081 kSharedMemoryOffset); |
| 1085 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1082 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1086 | 1083 |
| 1087 // TexImage2D is not allowed with GL_TEXTURE_EXTERNAL_OES targets. | 1084 // TexImage2D is not allowed with GL_TEXTURE_EXTERNAL_OES targets. |
| 1088 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); | 1085 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); |
| 1089 } | 1086 } |
| 1090 | 1087 |
| 1091 TEST_P(GLES2DecoderManualInitTest, DefaultTextureZero) { | 1088 TEST_P(GLES2DecoderManualInitTest, DefaultTextureZero) { |
| 1092 InitState init; | 1089 InitState init; |
| 1093 init.gl_version = "3.0"; | |
| 1094 InitDecoder(init); | 1090 InitDecoder(init); |
| 1095 | 1091 |
| 1096 BindTexture cmd1; | 1092 BindTexture cmd1; |
| 1097 cmd1.Init(GL_TEXTURE_2D, 0); | 1093 cmd1.Init(GL_TEXTURE_2D, 0); |
| 1098 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 0)); | 1094 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 0)); |
| 1099 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); | 1095 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); |
| 1100 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1096 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1101 | 1097 |
| 1102 BindTexture cmd2; | 1098 BindTexture cmd2; |
| 1103 cmd2.Init(GL_TEXTURE_CUBE_MAP, 0); | 1099 cmd2.Init(GL_TEXTURE_CUBE_MAP, 0); |
| 1104 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_CUBE_MAP, 0)); | 1100 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_CUBE_MAP, 0)); |
| 1105 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); | 1101 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); |
| 1106 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1102 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1107 } | 1103 } |
| 1108 | 1104 |
| 1109 TEST_P(GLES2DecoderManualInitTest, DefaultTextureBGR) { | 1105 TEST_P(GLES2DecoderManualInitTest, DefaultTextureBGR) { |
| 1110 InitState init; | 1106 InitState init; |
| 1111 init.gl_version = "3.0"; | |
| 1112 init.bind_generates_resource = true; | 1107 init.bind_generates_resource = true; |
| 1113 InitDecoder(init); | 1108 InitDecoder(init); |
| 1114 | 1109 |
| 1115 BindTexture cmd1; | 1110 BindTexture cmd1; |
| 1116 cmd1.Init(GL_TEXTURE_2D, 0); | 1111 cmd1.Init(GL_TEXTURE_2D, 0); |
| 1117 EXPECT_CALL( | 1112 EXPECT_CALL( |
| 1118 *gl_, BindTexture(GL_TEXTURE_2D, TestHelper::kServiceDefaultTexture2dId)); | 1113 *gl_, BindTexture(GL_TEXTURE_2D, TestHelper::kServiceDefaultTexture2dId)); |
| 1119 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); | 1114 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); |
| 1120 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1115 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1121 | 1116 |
| 1122 BindTexture cmd2; | 1117 BindTexture cmd2; |
| 1123 cmd2.Init(GL_TEXTURE_CUBE_MAP, 0); | 1118 cmd2.Init(GL_TEXTURE_CUBE_MAP, 0); |
| 1124 EXPECT_CALL(*gl_, | 1119 EXPECT_CALL(*gl_, |
| 1125 BindTexture(GL_TEXTURE_CUBE_MAP, | 1120 BindTexture(GL_TEXTURE_CUBE_MAP, |
| 1126 TestHelper::kServiceDefaultTextureCubemapId)); | 1121 TestHelper::kServiceDefaultTextureCubemapId)); |
| 1127 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); | 1122 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); |
| 1128 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1123 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1129 } | 1124 } |
| 1130 | 1125 |
| 1131 // Test that default texture 0 is immutable. | 1126 // Test that default texture 0 is immutable. |
| 1132 TEST_P(GLES2DecoderManualInitTest, NoDefaultTexParameterf) { | 1127 TEST_P(GLES2DecoderManualInitTest, NoDefaultTexParameterf) { |
| 1133 InitState init; | 1128 InitState init; |
| 1134 init.gl_version = "3.0"; | |
| 1135 InitDecoder(init); | 1129 InitDecoder(init); |
| 1136 | 1130 |
| 1137 { | 1131 { |
| 1138 BindTexture cmd1; | 1132 BindTexture cmd1; |
| 1139 cmd1.Init(GL_TEXTURE_2D, 0); | 1133 cmd1.Init(GL_TEXTURE_2D, 0); |
| 1140 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 0)); | 1134 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 0)); |
| 1141 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); | 1135 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); |
| 1142 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1136 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1143 | 1137 |
| 1144 TexParameterf cmd2; | 1138 TexParameterf cmd2; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1156 | 1150 |
| 1157 TexParameterf cmd2; | 1151 TexParameterf cmd2; |
| 1158 cmd2.Init(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | 1152 cmd2.Init(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
| 1159 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); | 1153 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); |
| 1160 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 1154 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 1161 } | 1155 } |
| 1162 } | 1156 } |
| 1163 | 1157 |
| 1164 TEST_P(GLES2DecoderManualInitTest, NoDefaultTexParameteri) { | 1158 TEST_P(GLES2DecoderManualInitTest, NoDefaultTexParameteri) { |
| 1165 InitState init; | 1159 InitState init; |
| 1166 init.gl_version = "3.0"; | |
| 1167 InitDecoder(init); | 1160 InitDecoder(init); |
| 1168 | 1161 |
| 1169 { | 1162 { |
| 1170 BindTexture cmd1; | 1163 BindTexture cmd1; |
| 1171 cmd1.Init(GL_TEXTURE_2D, 0); | 1164 cmd1.Init(GL_TEXTURE_2D, 0); |
| 1172 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 0)); | 1165 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 0)); |
| 1173 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); | 1166 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); |
| 1174 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1167 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1175 | 1168 |
| 1176 TexParameteri cmd2; | 1169 TexParameteri cmd2; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1188 | 1181 |
| 1189 TexParameteri cmd2; | 1182 TexParameteri cmd2; |
| 1190 cmd2.Init(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | 1183 cmd2.Init(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
| 1191 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); | 1184 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); |
| 1192 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 1185 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 1193 } | 1186 } |
| 1194 } | 1187 } |
| 1195 | 1188 |
| 1196 TEST_P(GLES2DecoderManualInitTest, NoDefaultTexParameterfv) { | 1189 TEST_P(GLES2DecoderManualInitTest, NoDefaultTexParameterfv) { |
| 1197 InitState init; | 1190 InitState init; |
| 1198 init.gl_version = "3.0"; | |
| 1199 InitDecoder(init); | 1191 InitDecoder(init); |
| 1200 | 1192 |
| 1201 { | 1193 { |
| 1202 BindTexture cmd1; | 1194 BindTexture cmd1; |
| 1203 cmd1.Init(GL_TEXTURE_2D, 0); | 1195 cmd1.Init(GL_TEXTURE_2D, 0); |
| 1204 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 0)); | 1196 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 0)); |
| 1205 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); | 1197 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); |
| 1206 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1198 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1207 | 1199 |
| 1208 GLfloat data = GL_NEAREST; | 1200 GLfloat data = GL_NEAREST; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1228 cmd2.Init(GL_TEXTURE_CUBE_MAP, | 1220 cmd2.Init(GL_TEXTURE_CUBE_MAP, |
| 1229 GL_TEXTURE_MAG_FILTER, | 1221 GL_TEXTURE_MAG_FILTER, |
| 1230 &data); | 1222 &data); |
| 1231 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd2, sizeof(data))); | 1223 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd2, sizeof(data))); |
| 1232 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 1224 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 1233 } | 1225 } |
| 1234 } | 1226 } |
| 1235 | 1227 |
| 1236 TEST_P(GLES2DecoderManualInitTest, NoDefaultTexParameteriv) { | 1228 TEST_P(GLES2DecoderManualInitTest, NoDefaultTexParameteriv) { |
| 1237 InitState init; | 1229 InitState init; |
| 1238 init.gl_version = "3.0"; | |
| 1239 InitDecoder(init); | 1230 InitDecoder(init); |
| 1240 | 1231 |
| 1241 { | 1232 { |
| 1242 BindTexture cmd1; | 1233 BindTexture cmd1; |
| 1243 cmd1.Init(GL_TEXTURE_2D, 0); | 1234 cmd1.Init(GL_TEXTURE_2D, 0); |
| 1244 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 0)); | 1235 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 0)); |
| 1245 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); | 1236 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); |
| 1246 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1237 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1247 | 1238 |
| 1248 GLfloat data = GL_NEAREST; | 1239 GLfloat data = GL_NEAREST; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1268 cmd2.Init(GL_TEXTURE_CUBE_MAP, | 1259 cmd2.Init(GL_TEXTURE_CUBE_MAP, |
| 1269 GL_TEXTURE_MAG_FILTER, | 1260 GL_TEXTURE_MAG_FILTER, |
| 1270 &data); | 1261 &data); |
| 1271 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd2, sizeof(data))); | 1262 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd2, sizeof(data))); |
| 1272 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 1263 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 1273 } | 1264 } |
| 1274 } | 1265 } |
| 1275 | 1266 |
| 1276 TEST_P(GLES2DecoderManualInitTest, NoDefaultTexImage2D) { | 1267 TEST_P(GLES2DecoderManualInitTest, NoDefaultTexImage2D) { |
| 1277 InitState init; | 1268 InitState init; |
| 1278 init.gl_version = "3.0"; | |
| 1279 InitDecoder(init); | 1269 InitDecoder(init); |
| 1280 | 1270 |
| 1281 BindTexture cmd1; | 1271 BindTexture cmd1; |
| 1282 cmd1.Init(GL_TEXTURE_2D, 0); | 1272 cmd1.Init(GL_TEXTURE_2D, 0); |
| 1283 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 0)); | 1273 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 0)); |
| 1284 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); | 1274 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); |
| 1285 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1275 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1286 | 1276 |
| 1287 TexImage2D cmd2; | 1277 TexImage2D cmd2; |
| 1288 cmd2.Init(GL_TEXTURE_2D, | 1278 cmd2.Init(GL_TEXTURE_2D, |
| 1289 0, | 1279 0, |
| 1290 GL_RGBA, | 1280 GL_RGBA, |
| 1291 2, | 1281 2, |
| 1292 2, | 1282 2, |
| 1293 GL_RGBA, | 1283 GL_RGBA, |
| 1294 GL_UNSIGNED_BYTE, | 1284 GL_UNSIGNED_BYTE, |
| 1295 kSharedMemoryId, | 1285 kSharedMemoryId, |
| 1296 kSharedMemoryOffset); | 1286 kSharedMemoryOffset); |
| 1297 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); | 1287 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); |
| 1298 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 1288 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 1299 } | 1289 } |
| 1300 | 1290 |
| 1301 TEST_P(GLES2DecoderManualInitTest, NoDefaultTexSubImage2D) { | 1291 TEST_P(GLES2DecoderManualInitTest, NoDefaultTexSubImage2D) { |
| 1302 InitState init; | 1292 InitState init; |
| 1303 init.gl_version = "3.0"; | |
| 1304 InitDecoder(init); | 1293 InitDecoder(init); |
| 1305 | 1294 |
| 1306 BindTexture cmd1; | 1295 BindTexture cmd1; |
| 1307 cmd1.Init(GL_TEXTURE_2D, 0); | 1296 cmd1.Init(GL_TEXTURE_2D, 0); |
| 1308 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 0)); | 1297 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 0)); |
| 1309 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); | 1298 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); |
| 1310 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1299 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1311 | 1300 |
| 1312 TexSubImage2D cmd2; | 1301 TexSubImage2D cmd2; |
| 1313 cmd2.Init(GL_TEXTURE_2D, | 1302 cmd2.Init(GL_TEXTURE_2D, |
| 1314 0, | 1303 0, |
| 1315 1, | 1304 1, |
| 1316 1, | 1305 1, |
| 1317 1, | 1306 1, |
| 1318 1, | 1307 1, |
| 1319 GL_RGBA, | 1308 GL_RGBA, |
| 1320 GL_UNSIGNED_BYTE, | 1309 GL_UNSIGNED_BYTE, |
| 1321 kSharedMemoryId, | 1310 kSharedMemoryId, |
| 1322 kSharedMemoryOffset, | 1311 kSharedMemoryOffset, |
| 1323 GL_FALSE); | 1312 GL_FALSE); |
| 1324 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); | 1313 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); |
| 1325 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 1314 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 1326 } | 1315 } |
| 1327 | 1316 |
| 1328 TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleBindTexture) { | 1317 TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleBindTexture) { |
| 1329 InitState init; | 1318 InitState init; |
| 1330 init.extensions = "GL_ARB_texture_rectangle"; | 1319 init.extensions = "GL_ARB_texture_rectangle"; |
| 1331 init.gl_version = "3.0"; | |
| 1332 init.bind_generates_resource = true; | 1320 init.bind_generates_resource = true; |
| 1333 InitDecoder(init); | 1321 InitDecoder(init); |
| 1334 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_RECTANGLE_ARB, kNewServiceId)); | 1322 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_RECTANGLE_ARB, kNewServiceId)); |
| 1335 EXPECT_CALL(*gl_, GenTextures(1, _)) | 1323 EXPECT_CALL(*gl_, GenTextures(1, _)) |
| 1336 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); | 1324 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); |
| 1337 BindTexture cmd; | 1325 BindTexture cmd; |
| 1338 cmd.Init(GL_TEXTURE_RECTANGLE_ARB, kNewClientId); | 1326 cmd.Init(GL_TEXTURE_RECTANGLE_ARB, kNewClientId); |
| 1339 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1327 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1340 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1328 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1341 Texture* texture = GetTexture(kNewClientId)->texture(); | 1329 Texture* texture = GetTexture(kNewClientId)->texture(); |
| 1342 EXPECT_TRUE(texture != NULL); | 1330 EXPECT_TRUE(texture != NULL); |
| 1343 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); | 1331 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); |
| 1344 } | 1332 } |
| 1345 | 1333 |
| 1346 TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleGetBinding) { | 1334 TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleGetBinding) { |
| 1347 InitState init; | 1335 InitState init; |
| 1348 init.extensions = "GL_ARB_texture_rectangle"; | 1336 init.extensions = "GL_ARB_texture_rectangle"; |
| 1349 init.gl_version = "3.0"; | |
| 1350 init.bind_generates_resource = true; | 1337 init.bind_generates_resource = true; |
| 1351 InitDecoder(init); | 1338 InitDecoder(init); |
| 1352 DoBindTexture( | 1339 DoBindTexture( |
| 1353 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); | 1340 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); |
| 1354 | 1341 |
| 1355 EXPECT_CALL(*gl_, GetError()) | 1342 EXPECT_CALL(*gl_, GetError()) |
| 1356 .WillOnce(Return(GL_NO_ERROR)) | 1343 .WillOnce(Return(GL_NO_ERROR)) |
| 1357 .WillOnce(Return(GL_NO_ERROR)) | 1344 .WillOnce(Return(GL_NO_ERROR)) |
| 1358 .RetiresOnSaturation(); | 1345 .RetiresOnSaturation(); |
| 1359 typedef GetIntegerv::Result Result; | 1346 typedef GetIntegerv::Result Result; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1370 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned( | 1357 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned( |
| 1371 GL_TEXTURE_BINDING_RECTANGLE_ARB), | 1358 GL_TEXTURE_BINDING_RECTANGLE_ARB), |
| 1372 result->GetNumResults()); | 1359 result->GetNumResults()); |
| 1373 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1360 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1374 EXPECT_EQ(client_texture_id_, (uint32)result->GetData()[0]); | 1361 EXPECT_EQ(client_texture_id_, (uint32)result->GetData()[0]); |
| 1375 } | 1362 } |
| 1376 | 1363 |
| 1377 TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTextureDefaults) { | 1364 TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTextureDefaults) { |
| 1378 InitState init; | 1365 InitState init; |
| 1379 init.extensions = "GL_ARB_texture_rectangle"; | 1366 init.extensions = "GL_ARB_texture_rectangle"; |
| 1380 init.gl_version = "3.0"; | |
| 1381 init.bind_generates_resource = true; | 1367 init.bind_generates_resource = true; |
| 1382 InitDecoder(init); | 1368 InitDecoder(init); |
| 1383 DoBindTexture( | 1369 DoBindTexture( |
| 1384 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); | 1370 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); |
| 1385 | 1371 |
| 1386 Texture* texture = GetTexture(client_texture_id_)->texture(); | 1372 Texture* texture = GetTexture(client_texture_id_)->texture(); |
| 1387 EXPECT_TRUE(texture != NULL); | 1373 EXPECT_TRUE(texture != NULL); |
| 1388 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); | 1374 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); |
| 1389 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); | 1375 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); |
| 1390 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); | 1376 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); |
| 1391 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); | 1377 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); |
| 1392 } | 1378 } |
| 1393 | 1379 |
| 1394 TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParam) { | 1380 TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParam) { |
| 1395 InitState init; | 1381 InitState init; |
| 1396 init.extensions = "GL_ARB_texture_rectangle"; | 1382 init.extensions = "GL_ARB_texture_rectangle"; |
| 1397 init.gl_version = "3.0"; | |
| 1398 init.bind_generates_resource = true; | 1383 init.bind_generates_resource = true; |
| 1399 InitDecoder(init); | 1384 InitDecoder(init); |
| 1400 | 1385 |
| 1401 DoBindTexture( | 1386 DoBindTexture( |
| 1402 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); | 1387 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); |
| 1403 | 1388 |
| 1404 EXPECT_CALL(*gl_, | 1389 EXPECT_CALL(*gl_, |
| 1405 TexParameteri( | 1390 TexParameteri( |
| 1406 GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST)); | 1391 GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST)); |
| 1407 EXPECT_CALL(*gl_, | 1392 EXPECT_CALL(*gl_, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1436 EXPECT_TRUE(texture != NULL); | 1421 EXPECT_TRUE(texture != NULL); |
| 1437 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); | 1422 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); |
| 1438 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); | 1423 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); |
| 1439 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); | 1424 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); |
| 1440 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); | 1425 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); |
| 1441 } | 1426 } |
| 1442 | 1427 |
| 1443 TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParamInvalid) { | 1428 TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParamInvalid) { |
| 1444 InitState init; | 1429 InitState init; |
| 1445 init.extensions = "GL_ARB_texture_rectangle"; | 1430 init.extensions = "GL_ARB_texture_rectangle"; |
| 1446 init.gl_version = "3.0"; | |
| 1447 init.bind_generates_resource = true; | 1431 init.bind_generates_resource = true; |
| 1448 InitDecoder(init); | 1432 InitDecoder(init); |
| 1449 | 1433 |
| 1450 DoBindTexture( | 1434 DoBindTexture( |
| 1451 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); | 1435 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); |
| 1452 | 1436 |
| 1453 TexParameteri cmd; | 1437 TexParameteri cmd; |
| 1454 cmd.Init(GL_TEXTURE_RECTANGLE_ARB, | 1438 cmd.Init(GL_TEXTURE_RECTANGLE_ARB, |
| 1455 GL_TEXTURE_MIN_FILTER, | 1439 GL_TEXTURE_MIN_FILTER, |
| 1456 GL_NEAREST_MIPMAP_NEAREST); | 1440 GL_NEAREST_MIPMAP_NEAREST); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1469 EXPECT_TRUE(texture != NULL); | 1453 EXPECT_TRUE(texture != NULL); |
| 1470 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); | 1454 EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB); |
| 1471 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); | 1455 EXPECT_TRUE(texture->min_filter() == GL_LINEAR); |
| 1472 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); | 1456 EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE); |
| 1473 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); | 1457 EXPECT_TRUE(texture->wrap_t() == GL_CLAMP_TO_EDGE); |
| 1474 } | 1458 } |
| 1475 | 1459 |
| 1476 TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2DError) { | 1460 TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2DError) { |
| 1477 InitState init; | 1461 InitState init; |
| 1478 init.extensions = "GL_ARB_texture_rectangle"; | 1462 init.extensions = "GL_ARB_texture_rectangle"; |
| 1479 init.gl_version = "3.0"; | |
| 1480 init.bind_generates_resource = true; | 1463 init.bind_generates_resource = true; |
| 1481 InitDecoder(init); | 1464 InitDecoder(init); |
| 1482 | 1465 |
| 1483 GLenum target = GL_TEXTURE_RECTANGLE_ARB; | 1466 GLenum target = GL_TEXTURE_RECTANGLE_ARB; |
| 1484 GLint level = 0; | 1467 GLint level = 0; |
| 1485 GLenum internal_format = GL_RGBA; | 1468 GLenum internal_format = GL_RGBA; |
| 1486 GLsizei width = 2; | 1469 GLsizei width = 2; |
| 1487 GLsizei height = 4; | 1470 GLsizei height = 4; |
| 1488 GLenum format = GL_RGBA; | 1471 GLenum format = GL_RGBA; |
| 1489 GLenum type = GL_UNSIGNED_BYTE; | 1472 GLenum type = GL_UNSIGNED_BYTE; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1625 } | 1608 } |
| 1626 | 1609 |
| 1627 TEST_P( | 1610 TEST_P( |
| 1628 GLES2DecoderManualInitTest, | 1611 GLES2DecoderManualInitTest, |
| 1629 TexSubImage2DDoesNotClearAfterTexImage2DNULLThenDataWithTexImage2DIsFaster)
{ | 1612 TexSubImage2DDoesNotClearAfterTexImage2DNULLThenDataWithTexImage2DIsFaster)
{ |
| 1630 base::CommandLine command_line(0, NULL); | 1613 base::CommandLine command_line(0, NULL); |
| 1631 command_line.AppendSwitchASCII( | 1614 command_line.AppendSwitchASCII( |
| 1632 switches::kGpuDriverBugWorkarounds, | 1615 switches::kGpuDriverBugWorkarounds, |
| 1633 base::IntToString(gpu::TEXSUBIMAGE2D_FASTER_THAN_TEXIMAGE2D)); | 1616 base::IntToString(gpu::TEXSUBIMAGE2D_FASTER_THAN_TEXIMAGE2D)); |
| 1634 InitState init; | 1617 InitState init; |
| 1635 init.gl_version = "3.0"; | |
| 1636 init.bind_generates_resource = true; | 1618 init.bind_generates_resource = true; |
| 1637 InitDecoderWithCommandLine(init, &command_line); | 1619 InitDecoderWithCommandLine(init, &command_line); |
| 1638 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 1620 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 1639 DoTexImage2D( | 1621 DoTexImage2D( |
| 1640 GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); | 1622 GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); |
| 1641 | 1623 |
| 1642 { | 1624 { |
| 1643 // Uses texSubimage internally because the above workaround is active and | 1625 // Uses texSubimage internally because the above workaround is active and |
| 1644 // the update is for the full size of the texture. | 1626 // the update is for the full size of the texture. |
| 1645 EXPECT_CALL(*gl_, | 1627 EXPECT_CALL(*gl_, |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1827 TextureManager* manager = group().texture_manager(); | 1809 TextureManager* manager = group().texture_manager(); |
| 1828 TextureRef* texture_ref = manager->GetTexture(client_texture_id_); | 1810 TextureRef* texture_ref = manager->GetTexture(client_texture_id_); |
| 1829 ASSERT_TRUE(texture_ref != NULL); | 1811 ASSERT_TRUE(texture_ref != NULL); |
| 1830 Texture* texture = texture_ref->texture(); | 1812 Texture* texture = texture_ref->texture(); |
| 1831 EXPECT_TRUE(texture->SafeToRenderFrom()); | 1813 EXPECT_TRUE(texture->SafeToRenderFrom()); |
| 1832 } | 1814 } |
| 1833 | 1815 |
| 1834 TEST_P(GLES2DecoderManualInitTest, CompressedImage2DMarksTextureAsCleared) { | 1816 TEST_P(GLES2DecoderManualInitTest, CompressedImage2DMarksTextureAsCleared) { |
| 1835 InitState init; | 1817 InitState init; |
| 1836 init.extensions = "GL_EXT_texture_compression_s3tc"; | 1818 init.extensions = "GL_EXT_texture_compression_s3tc"; |
| 1837 init.gl_version = "3.0"; | |
| 1838 init.bind_generates_resource = true; | 1819 init.bind_generates_resource = true; |
| 1839 InitDecoder(init); | 1820 InitDecoder(init); |
| 1840 | 1821 |
| 1841 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 1822 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 1842 EXPECT_CALL(*gl_, GetError()) | 1823 EXPECT_CALL(*gl_, GetError()) |
| 1843 .WillOnce(Return(GL_NO_ERROR)) | 1824 .WillOnce(Return(GL_NO_ERROR)) |
| 1844 .RetiresOnSaturation(); | 1825 .RetiresOnSaturation(); |
| 1845 EXPECT_CALL( | 1826 EXPECT_CALL( |
| 1846 *gl_, | 1827 *gl_, |
| 1847 CompressedTexImage2D( | 1828 CompressedTexImage2D( |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2656 kSharedMemoryId, | 2637 kSharedMemoryId, |
| 2657 kSharedMemoryOffset, | 2638 kSharedMemoryOffset, |
| 2658 GL_FALSE); | 2639 GL_FALSE); |
| 2659 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 2640 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 2660 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 2641 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 2661 } | 2642 } |
| 2662 | 2643 |
| 2663 TEST_P(GLES2DecoderManualInitTest, TexImage2DFloatConvertsFormatDesktop) { | 2644 TEST_P(GLES2DecoderManualInitTest, TexImage2DFloatConvertsFormatDesktop) { |
| 2664 InitState init; | 2645 InitState init; |
| 2665 init.extensions = "GL_ARB_texture_float"; | 2646 init.extensions = "GL_ARB_texture_float"; |
| 2666 init.gl_version = "2.1"; | |
| 2667 InitDecoder(init); | 2647 InitDecoder(init); |
| 2668 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 2648 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 2669 DoTexImage2D( | 2649 DoTexImage2D( |
| 2670 GL_TEXTURE_2D, 0, GL_RGBA32F, 16, 17, 0, GL_RGBA, GL_FLOAT, 0, 0); | 2650 GL_TEXTURE_2D, 0, GL_RGBA32F, 16, 17, 0, GL_RGBA, GL_FLOAT, 0, 0); |
| 2671 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGB32F, 16, 17, 0, GL_RGB, GL_FLOAT, 0, 0); | 2651 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGB32F, 16, 17, 0, GL_RGB, GL_FLOAT, 0, 0); |
| 2672 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, | 2652 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, |
| 2673 0, | 2653 0, |
| 2674 GL_RGBA, | 2654 GL_RGBA, |
| 2675 16, | 2655 16, |
| 2676 17, | 2656 17, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2735 if (array[ii] == value) { | 2715 if (array[ii] == value) { |
| 2736 return true; | 2716 return true; |
| 2737 } | 2717 } |
| 2738 } | 2718 } |
| 2739 return false; | 2719 return false; |
| 2740 } | 2720 } |
| 2741 | 2721 |
| 2742 void CheckFormats(const char* extension, const GLenum* formats, int count) { | 2722 void CheckFormats(const char* extension, const GLenum* formats, int count) { |
| 2743 InitState init; | 2723 InitState init; |
| 2744 init.extensions = extension; | 2724 init.extensions = extension; |
| 2745 init.gl_version = "3.0"; | |
| 2746 init.bind_generates_resource = true; | 2725 init.bind_generates_resource = true; |
| 2747 InitDecoder(init); | 2726 InitDecoder(init); |
| 2748 | 2727 |
| 2749 EXPECT_CALL(*gl_, GetError()) | 2728 EXPECT_CALL(*gl_, GetError()) |
| 2750 .WillOnce(Return(GL_NO_ERROR)) | 2729 .WillOnce(Return(GL_NO_ERROR)) |
| 2751 .WillOnce(Return(GL_NO_ERROR)) | 2730 .WillOnce(Return(GL_NO_ERROR)) |
| 2752 .WillOnce(Return(GL_NO_ERROR)) | 2731 .WillOnce(Return(GL_NO_ERROR)) |
| 2753 .WillOnce(Return(GL_NO_ERROR)) | 2732 .WillOnce(Return(GL_NO_ERROR)) |
| 2754 .RetiresOnSaturation(); | 2733 .RetiresOnSaturation(); |
| 2755 | 2734 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2807 CheckFormats("GL_IMG_texture_compression_pvrtc", formats, 4); | 2786 CheckFormats("GL_IMG_texture_compression_pvrtc", formats, 4); |
| 2808 } | 2787 } |
| 2809 | 2788 |
| 2810 TEST_P(GLES2DecoderCompressedFormatsTest, GetCompressedTextureFormatsETC1) { | 2789 TEST_P(GLES2DecoderCompressedFormatsTest, GetCompressedTextureFormatsETC1) { |
| 2811 const GLenum formats[] = {GL_ETC1_RGB8_OES}; | 2790 const GLenum formats[] = {GL_ETC1_RGB8_OES}; |
| 2812 CheckFormats("GL_OES_compressed_ETC1_RGB8_texture", formats, 1); | 2791 CheckFormats("GL_OES_compressed_ETC1_RGB8_texture", formats, 1); |
| 2813 } | 2792 } |
| 2814 | 2793 |
| 2815 TEST_P(GLES2DecoderManualInitTest, GetNoCompressedTextureFormats) { | 2794 TEST_P(GLES2DecoderManualInitTest, GetNoCompressedTextureFormats) { |
| 2816 InitState init; | 2795 InitState init; |
| 2817 init.gl_version = "3.0"; | |
| 2818 init.bind_generates_resource = true; | 2796 init.bind_generates_resource = true; |
| 2819 InitDecoder(init); | 2797 InitDecoder(init); |
| 2820 | 2798 |
| 2821 EXPECT_CALL(*gl_, GetError()) | 2799 EXPECT_CALL(*gl_, GetError()) |
| 2822 .WillOnce(Return(GL_NO_ERROR)) | 2800 .WillOnce(Return(GL_NO_ERROR)) |
| 2823 .WillOnce(Return(GL_NO_ERROR)) | 2801 .WillOnce(Return(GL_NO_ERROR)) |
| 2824 .WillOnce(Return(GL_NO_ERROR)) | 2802 .WillOnce(Return(GL_NO_ERROR)) |
| 2825 .WillOnce(Return(GL_NO_ERROR)) | 2803 .WillOnce(Return(GL_NO_ERROR)) |
| 2826 .RetiresOnSaturation(); | 2804 .RetiresOnSaturation(); |
| 2827 | 2805 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2859 // TODO(gman): CompressedTexSubImage2DImmediate | 2837 // TODO(gman): CompressedTexSubImage2DImmediate |
| 2860 | 2838 |
| 2861 // TODO(gman): TexImage2D | 2839 // TODO(gman): TexImage2D |
| 2862 | 2840 |
| 2863 // TODO(gman): TexImage2DImmediate | 2841 // TODO(gman): TexImage2DImmediate |
| 2864 | 2842 |
| 2865 // TODO(gman): TexSubImage2DImmediate | 2843 // TODO(gman): TexSubImage2DImmediate |
| 2866 | 2844 |
| 2867 } // namespace gles2 | 2845 } // namespace gles2 |
| 2868 } // namespace gpu | 2846 } // namespace gpu |
| OLD | NEW |