OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/common/gles2_cmd_utils.h" | 5 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <GLES2/gl2.h> | 8 #include <GLES2/gl2.h> |
9 #include <GLES2/gl2ext.h> | 9 #include <GLES2/gl2ext.h> |
10 #include <GLES2/gl2extchromium.h> | 10 #include <GLES2/gl2extchromium.h> |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 TEST_F(GLES2UtilTest, GetChannelsForCompressedFormat) { | 238 TEST_F(GLES2UtilTest, GetChannelsForCompressedFormat) { |
239 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat(GL_ETC1_RGB8_OES)); | 239 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat(GL_ETC1_RGB8_OES)); |
240 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat( | 240 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat( |
241 GL_COMPRESSED_RGB_S3TC_DXT1_EXT)); | 241 GL_COMPRESSED_RGB_S3TC_DXT1_EXT)); |
242 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat( | 242 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat( |
243 GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)); | 243 GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)); |
244 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat( | 244 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat( |
245 GL_COMPRESSED_RGBA_S3TC_DXT3_EXT)); | 245 GL_COMPRESSED_RGBA_S3TC_DXT3_EXT)); |
246 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat( | 246 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat( |
247 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)); | 247 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)); |
| 248 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat(GL_ATC_RGB_AMD)); |
| 249 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat( |
| 250 GL_ATC_RGBA_EXPLICIT_ALPHA_AMD)); |
| 251 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat( |
| 252 GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD)); |
| 253 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat( |
| 254 GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG)); |
| 255 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat( |
| 256 GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG)); |
| 257 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat( |
| 258 GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG)); |
| 259 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat( |
| 260 GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG)); |
248 } | 261 } |
249 | 262 |
250 namespace { | 263 namespace { |
251 | 264 |
252 void CheckParseUniformName( | 265 void CheckParseUniformName( |
253 const char* name, | 266 const char* name, |
254 bool expected_success, | 267 bool expected_success, |
255 size_t expected_array_pos, | 268 size_t expected_array_pos, |
256 int expected_index, | 269 int expected_index, |
257 bool expected_getting_array) { | 270 bool expected_getting_array) { |
(...skipping 26 matching lines...) Expand all Loading... |
284 CheckParseUniformName("u_name[020]", true, 6u, 20, true); | 297 CheckParseUniformName("u_name[020]", true, 6u, 20, true); |
285 CheckParseUniformName("u_name[0][0]", true, 9u, 0, true); | 298 CheckParseUniformName("u_name[0][0]", true, 9u, 0, true); |
286 CheckParseUniformName("u_name[3][2]", true, 9u, 2, true); | 299 CheckParseUniformName("u_name[3][2]", true, 9u, 2, true); |
287 CheckParseUniformName("u_name[03][02]", true, 10u, 2, true); | 300 CheckParseUniformName("u_name[03][02]", true, 10u, 2, true); |
288 CheckParseUniformName("u_name[30][20]", true, 10u, 20, true); | 301 CheckParseUniformName("u_name[30][20]", true, 10u, 20, true); |
289 CheckParseUniformName("u_name[030][020]", true, 11u, 20, true); | 302 CheckParseUniformName("u_name[030][020]", true, 11u, 20, true); |
290 } | 303 } |
291 | 304 |
292 } // namespace gles2 | 305 } // namespace gles2 |
293 } // namespace gpu | 306 } // namespace gpu |
OLD | NEW |