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