Chromium Code Reviews| 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/service/texture_manager.h" | 5 #include "gpu/command_buffer/service/texture_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 void SetUp() override { | 71 void SetUp() override { |
| 72 GpuServiceTest::SetUp(); | 72 GpuServiceTest::SetUp(); |
| 73 manager_.reset(new TextureManager(NULL, | 73 manager_.reset(new TextureManager(NULL, |
| 74 feature_info_.get(), | 74 feature_info_.get(), |
| 75 kMaxTextureSize, | 75 kMaxTextureSize, |
| 76 kMaxCubeMapTextureSize, | 76 kMaxCubeMapTextureSize, |
| 77 kMaxRectangleTextureSize, | 77 kMaxRectangleTextureSize, |
| 78 kMax3DTextureSize, | 78 kMax3DTextureSize, |
| 79 kUseDefaultTextures)); | 79 kUseDefaultTextures)); |
| 80 TestHelper::SetupTextureManagerInitExpectations( | 80 TestHelper::SetupTextureManagerInitExpectations( |
| 81 gl_.get(), "", kUseDefaultTextures); | 81 gl_.get(), false, "", kUseDefaultTextures); |
| 82 manager_->Initialize(); | 82 manager_->Initialize(); |
| 83 error_state_.reset(new ::testing::StrictMock<gles2::MockErrorState>()); | 83 error_state_.reset(new ::testing::StrictMock<gles2::MockErrorState>()); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void TearDown() override { | 86 void TearDown() override { |
| 87 manager_->Destroy(false); | 87 manager_->Destroy(false); |
| 88 manager_.reset(); | 88 manager_.reset(); |
| 89 GpuServiceTest::TearDown(); | 89 GpuServiceTest::TearDown(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void SetParameter( | 92 void SetParameter( |
| 93 TextureRef* texture_ref, GLenum pname, GLint value, GLenum error) { | 93 TextureRef* texture_ref, GLenum pname, GLint value, GLenum error) { |
| 94 TestHelper::SetTexParameteriWithExpectations( | 94 TestHelper::SetTexParameteriWithExpectations( |
| 95 gl_.get(), error_state_.get(), manager_.get(), | 95 gl_.get(), error_state_.get(), manager_.get(), |
| 96 texture_ref, pname, value, error); | 96 texture_ref, pname, value, error); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void SetupFeatureInfo(const char* gl_extensions, | |
| 100 const char* gl_version, | |
| 101 bool enable_es3 = false) { | |
|
Zhenyao Mo
2015/09/17 16:57:01
OK, default argument is not allowed in Chrome. htt
| |
| 102 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( | |
| 103 gl_.get(), gl_extensions, "", gl_version); | |
| 104 feature_info_->Initialize(); | |
| 105 if (enable_es3) { | |
| 106 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS, _)) | |
| 107 .WillOnce(SetArgPointee<1>(8)) | |
| 108 .RetiresOnSaturation(); | |
| 109 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_DRAW_BUFFERS, _)) | |
| 110 .WillOnce(SetArgPointee<1>(8)) | |
| 111 .RetiresOnSaturation(); | |
| 112 feature_info_->EnableES3Validators(); | |
| 113 } | |
| 114 } | |
| 115 | |
| 99 scoped_refptr<FeatureInfo> feature_info_; | 116 scoped_refptr<FeatureInfo> feature_info_; |
| 100 scoped_ptr<TextureManager> manager_; | 117 scoped_ptr<TextureManager> manager_; |
| 101 scoped_ptr<MockErrorState> error_state_; | 118 scoped_ptr<MockErrorState> error_state_; |
| 102 }; | 119 }; |
| 103 | 120 |
| 104 // GCC requires these declarations, but MSVC requires they not be present | 121 // GCC requires these declarations, but MSVC requires they not be present |
| 105 #ifndef COMPILER_MSVC | 122 #ifndef COMPILER_MSVC |
| 106 const GLint TextureManagerTest::kMaxTextureSize; | 123 const GLint TextureManagerTest::kMaxTextureSize; |
| 107 const GLint TextureManagerTest::kMaxCubeMapTextureSize; | 124 const GLint TextureManagerTest::kMaxCubeMapTextureSize; |
| 108 const GLint TextureManagerTest::kMaxRectangleTextureSize; | 125 const GLint TextureManagerTest::kMaxRectangleTextureSize; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 EXPECT_EQ(static_cast<GLenum>(GL_NEAREST), texture->min_filter()); | 187 EXPECT_EQ(static_cast<GLenum>(GL_NEAREST), texture->min_filter()); |
| 171 SetParameter(texture_ref, GL_TEXTURE_WRAP_S, GL_NEAREST, GL_INVALID_ENUM); | 188 SetParameter(texture_ref, GL_TEXTURE_WRAP_S, GL_NEAREST, GL_INVALID_ENUM); |
| 172 EXPECT_EQ(static_cast<GLenum>(GL_CLAMP_TO_EDGE), texture->wrap_s()); | 189 EXPECT_EQ(static_cast<GLenum>(GL_CLAMP_TO_EDGE), texture->wrap_s()); |
| 173 SetParameter(texture_ref, GL_TEXTURE_WRAP_T, GL_NEAREST, GL_INVALID_ENUM); | 190 SetParameter(texture_ref, GL_TEXTURE_WRAP_T, GL_NEAREST, GL_INVALID_ENUM); |
| 174 EXPECT_EQ(static_cast<GLenum>(GL_CLAMP_TO_EDGE), texture->wrap_t()); | 191 EXPECT_EQ(static_cast<GLenum>(GL_CLAMP_TO_EDGE), texture->wrap_t()); |
| 175 SetParameter(texture_ref, GL_TEXTURE_MAX_ANISOTROPY_EXT, 0, GL_INVALID_VALUE); | 192 SetParameter(texture_ref, GL_TEXTURE_MAX_ANISOTROPY_EXT, 0, GL_INVALID_VALUE); |
| 176 } | 193 } |
| 177 | 194 |
| 178 TEST_F(TextureManagerTest, UseDefaultTexturesTrue) { | 195 TEST_F(TextureManagerTest, UseDefaultTexturesTrue) { |
| 179 bool use_default_textures = true; | 196 bool use_default_textures = true; |
| 180 scoped_refptr<FeatureInfo> feature_info(new FeatureInfo()); | 197 TestHelper::SetupTextureManagerInitExpectations(gl_.get(), |
| 181 | 198 false, "GL_ANGLE_texture_usage", use_default_textures); |
| 182 TestHelper::SetupTextureManagerInitExpectations( | |
| 183 gl_.get(), "GL_ANGLE_texture_usage", use_default_textures); | |
| 184 TextureManager manager(NULL, | 199 TextureManager manager(NULL, |
| 185 feature_info_.get(), | 200 feature_info_.get(), |
| 186 kMaxTextureSize, | 201 kMaxTextureSize, |
| 187 kMaxCubeMapTextureSize, | 202 kMaxCubeMapTextureSize, |
| 188 kMaxRectangleTextureSize, | 203 kMaxRectangleTextureSize, |
| 189 kMax3DTextureSize, | 204 kMax3DTextureSize, |
| 190 use_default_textures); | 205 use_default_textures); |
| 191 manager.Initialize(); | 206 manager.Initialize(); |
| 192 | 207 |
| 193 EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_2D) != NULL); | 208 EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_2D) != NULL); |
| 194 EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_CUBE_MAP) != NULL); | 209 EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_CUBE_MAP) != NULL); |
| 195 | 210 |
| 196 // TODO(vmiura): Test GL_TEXTURE_EXTERNAL_OES & GL_TEXTURE_RECTANGLE_ARB. | 211 // TODO(vmiura): Test GL_TEXTURE_EXTERNAL_OES & GL_TEXTURE_RECTANGLE_ARB. |
| 197 | 212 |
| 198 manager.Destroy(false); | 213 manager.Destroy(false); |
| 199 } | 214 } |
| 200 | 215 |
| 201 TEST_F(TextureManagerTest, UseDefaultTexturesFalse) { | 216 TEST_F(TextureManagerTest, UseDefaultTexturesFalse) { |
| 202 bool use_default_textures = false; | 217 bool use_default_textures = false; |
| 203 TestHelper::SetupTextureManagerInitExpectations( | 218 TestHelper::SetupTextureManagerInitExpectations(gl_.get(), |
| 204 gl_.get(), "GL_ANGLE_texture_usage", use_default_textures); | 219 false, "GL_ANGLE_texture_usage", use_default_textures); |
| 205 TextureManager manager(NULL, | 220 TextureManager manager(NULL, |
| 206 feature_info_.get(), | 221 feature_info_.get(), |
| 207 kMaxTextureSize, | 222 kMaxTextureSize, |
| 208 kMaxCubeMapTextureSize, | 223 kMaxCubeMapTextureSize, |
| 209 kMaxRectangleTextureSize, | 224 kMaxRectangleTextureSize, |
| 210 kMax3DTextureSize, | 225 kMax3DTextureSize, |
| 211 use_default_textures); | 226 use_default_textures); |
| 212 manager.Initialize(); | 227 manager.Initialize(); |
| 213 | 228 |
| 214 EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_2D) == NULL); | 229 EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_2D) == NULL); |
| 215 EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_CUBE_MAP) == NULL); | 230 EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_CUBE_MAP) == NULL); |
| 216 | 231 |
| 217 // TODO(vmiura): Test GL_TEXTURE_EXTERNAL_OES & GL_TEXTURE_RECTANGLE_ARB. | 232 // TODO(vmiura): Test GL_TEXTURE_EXTERNAL_OES & GL_TEXTURE_RECTANGLE_ARB. |
| 218 | 233 |
| 219 manager.Destroy(false); | 234 manager.Destroy(false); |
| 220 } | 235 } |
| 221 | 236 |
| 237 TEST_F(TextureManagerTest, UseDefaultTexturesTrueES3) { | |
| 238 bool use_default_textures = true; | |
| 239 SetupFeatureInfo("", "OpenGL ES 3.0", true); | |
| 240 TestHelper::SetupTextureManagerInitExpectations(gl_.get(), | |
| 241 true, "", use_default_textures); | |
| 242 TextureManager manager(NULL, | |
| 243 feature_info_.get(), | |
| 244 kMaxTextureSize, | |
| 245 kMaxCubeMapTextureSize, | |
| 246 kMaxRectangleTextureSize, | |
| 247 kMax3DTextureSize, | |
| 248 use_default_textures); | |
| 249 manager.Initialize(); | |
| 250 | |
| 251 EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_3D) != NULL); | |
| 252 EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_2D_ARRAY) != NULL); | |
| 253 | |
| 254 manager.Destroy(false); | |
| 255 } | |
| 256 | |
| 257 TEST_F(TextureManagerTest, UseDefaultTexturesFalseES3) { | |
| 258 bool use_default_textures = false; | |
| 259 SetupFeatureInfo("", "OpenGL ES 3.0", true); | |
| 260 TestHelper::SetupTextureManagerInitExpectations(gl_.get(), | |
| 261 true, "", use_default_textures); | |
| 262 TextureManager manager(NULL, | |
| 263 feature_info_.get(), | |
| 264 kMaxTextureSize, | |
| 265 kMaxCubeMapTextureSize, | |
| 266 kMaxRectangleTextureSize, | |
| 267 kMax3DTextureSize, | |
| 268 use_default_textures); | |
| 269 manager.Initialize(); | |
| 270 | |
| 271 EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_3D) == NULL); | |
| 272 EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_2D_ARRAY) == NULL); | |
| 273 | |
| 274 manager.Destroy(false); | |
| 275 } | |
| 276 | |
| 222 TEST_F(TextureManagerTest, TextureUsageExt) { | 277 TEST_F(TextureManagerTest, TextureUsageExt) { |
| 223 TestHelper::SetupTextureManagerInitExpectations( | 278 TestHelper::SetupTextureManagerInitExpectations( |
| 224 gl_.get(), "GL_ANGLE_texture_usage", kUseDefaultTextures); | 279 gl_.get(), false, "GL_ANGLE_texture_usage", kUseDefaultTextures); |
| 225 TextureManager manager(NULL, | 280 TextureManager manager(NULL, |
| 226 feature_info_.get(), | 281 feature_info_.get(), |
| 227 kMaxTextureSize, | 282 kMaxTextureSize, |
| 228 kMaxCubeMapTextureSize, | 283 kMaxCubeMapTextureSize, |
| 229 kMaxRectangleTextureSize, | 284 kMaxRectangleTextureSize, |
| 230 kMax3DTextureSize, | 285 kMax3DTextureSize, |
| 231 kUseDefaultTextures); | 286 kUseDefaultTextures); |
| 232 manager.Initialize(); | 287 manager.Initialize(); |
| 233 const GLuint kClient1Id = 1; | 288 const GLuint kClient1Id = 1; |
| 234 const GLuint kService1Id = 11; | 289 const GLuint kService1Id = 11; |
| 235 // Check we can create texture. | 290 // Check we can create texture. |
| 236 manager.CreateTexture(kClient1Id, kService1Id); | 291 manager.CreateTexture(kClient1Id, kService1Id); |
| 237 // Check texture got created. | 292 // Check texture got created. |
| 238 TextureRef* texture_ref = manager.GetTexture(kClient1Id); | 293 TextureRef* texture_ref = manager.GetTexture(kClient1Id); |
| 239 ASSERT_TRUE(texture_ref != NULL); | 294 ASSERT_TRUE(texture_ref != NULL); |
| 240 TestHelper::SetTexParameteriWithExpectations( | 295 TestHelper::SetTexParameteriWithExpectations( |
| 241 gl_.get(), error_state_.get(), &manager, texture_ref, | 296 gl_.get(), error_state_.get(), &manager, texture_ref, |
| 242 GL_TEXTURE_USAGE_ANGLE, GL_FRAMEBUFFER_ATTACHMENT_ANGLE, GL_NO_ERROR); | 297 GL_TEXTURE_USAGE_ANGLE, GL_FRAMEBUFFER_ATTACHMENT_ANGLE, GL_NO_ERROR); |
| 243 EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_ATTACHMENT_ANGLE), | 298 EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_ATTACHMENT_ANGLE), |
| 244 texture_ref->texture()->usage()); | 299 texture_ref->texture()->usage()); |
| 245 manager.Destroy(false); | 300 manager.Destroy(false); |
| 246 } | 301 } |
| 247 | 302 |
| 248 TEST_F(TextureManagerTest, Destroy) { | 303 TEST_F(TextureManagerTest, Destroy) { |
| 249 const GLuint kClient1Id = 1; | 304 const GLuint kClient1Id = 1; |
| 250 const GLuint kService1Id = 11; | 305 const GLuint kService1Id = 11; |
| 251 TestHelper::SetupTextureManagerInitExpectations( | 306 TestHelper::SetupTextureManagerInitExpectations( |
| 252 gl_.get(), "", kUseDefaultTextures); | 307 gl_.get(), false, "", kUseDefaultTextures); |
| 253 TextureManager manager(NULL, | 308 TextureManager manager(NULL, |
| 254 feature_info_.get(), | 309 feature_info_.get(), |
| 255 kMaxTextureSize, | 310 kMaxTextureSize, |
| 256 kMaxCubeMapTextureSize, | 311 kMaxCubeMapTextureSize, |
| 257 kMaxRectangleTextureSize, | 312 kMaxRectangleTextureSize, |
| 258 kMax3DTextureSize, | 313 kMax3DTextureSize, |
| 259 kUseDefaultTextures); | 314 kUseDefaultTextures); |
| 260 manager.Initialize(); | 315 manager.Initialize(); |
| 261 // Check we can create texture. | 316 // Check we can create texture. |
| 262 manager.CreateTexture(kClient1Id, kService1Id); | 317 manager.CreateTexture(kClient1Id, kService1Id); |
| 263 // Check texture got created. | 318 // Check texture got created. |
| 264 TextureRef* texture = manager.GetTexture(kClient1Id); | 319 TextureRef* texture = manager.GetTexture(kClient1Id); |
| 265 ASSERT_TRUE(texture != NULL); | 320 ASSERT_TRUE(texture != NULL); |
| 266 EXPECT_CALL(*gl_, DeleteTextures(1, ::testing::Pointee(kService1Id))) | 321 EXPECT_CALL(*gl_, DeleteTextures(1, ::testing::Pointee(kService1Id))) |
| 267 .Times(1) | 322 .Times(1) |
| 268 .RetiresOnSaturation(); | 323 .RetiresOnSaturation(); |
| 269 TestHelper::SetupTextureManagerDestructionExpectations( | 324 TestHelper::SetupTextureManagerDestructionExpectations( |
| 270 gl_.get(), "", kUseDefaultTextures); | 325 gl_.get(), false, "", kUseDefaultTextures); |
| 271 manager.Destroy(true); | 326 manager.Destroy(true); |
| 272 // Check that resources got freed. | 327 // Check that resources got freed. |
| 273 texture = manager.GetTexture(kClient1Id); | 328 texture = manager.GetTexture(kClient1Id); |
| 274 ASSERT_TRUE(texture == NULL); | 329 ASSERT_TRUE(texture == NULL); |
| 275 } | 330 } |
| 276 | 331 |
| 277 TEST_F(TextureManagerTest, MaxValues) { | 332 TEST_F(TextureManagerTest, MaxValues) { |
| 278 // Check we get the right values for the max sizes. | 333 // Check we get the right values for the max sizes. |
| 279 EXPECT_EQ(kMax2dLevels, manager_->MaxLevelsForTarget(GL_TEXTURE_2D)); | 334 EXPECT_EQ(kMax2dLevels, manager_->MaxLevelsForTarget(GL_TEXTURE_2D)); |
| 280 EXPECT_EQ(kMaxCubeMapLevels, | 335 EXPECT_EQ(kMaxCubeMapLevels, |
| (...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1817 memory_tracker2_ = new CountingMemoryTracker; | 1872 memory_tracker2_ = new CountingMemoryTracker; |
| 1818 texture_manager2_.reset( | 1873 texture_manager2_.reset( |
| 1819 new TextureManager(memory_tracker2_.get(), | 1874 new TextureManager(memory_tracker2_.get(), |
| 1820 feature_info_.get(), | 1875 feature_info_.get(), |
| 1821 TextureManagerTest::kMaxTextureSize, | 1876 TextureManagerTest::kMaxTextureSize, |
| 1822 TextureManagerTest::kMaxCubeMapTextureSize, | 1877 TextureManagerTest::kMaxCubeMapTextureSize, |
| 1823 TextureManagerTest::kMaxRectangleTextureSize, | 1878 TextureManagerTest::kMaxRectangleTextureSize, |
| 1824 TextureManagerTest::kMax3DTextureSize, | 1879 TextureManagerTest::kMax3DTextureSize, |
| 1825 kUseDefaultTextures)); | 1880 kUseDefaultTextures)); |
| 1826 TestHelper::SetupTextureManagerInitExpectations( | 1881 TestHelper::SetupTextureManagerInitExpectations( |
| 1827 gl_.get(), "", kUseDefaultTextures); | 1882 gl_.get(), false, "", kUseDefaultTextures); |
| 1828 texture_manager1_->Initialize(); | 1883 texture_manager1_->Initialize(); |
| 1829 TestHelper::SetupTextureManagerInitExpectations( | 1884 TestHelper::SetupTextureManagerInitExpectations( |
| 1830 gl_.get(), "", kUseDefaultTextures); | 1885 gl_.get(), false, "", kUseDefaultTextures); |
| 1831 texture_manager2_->Initialize(); | 1886 texture_manager2_->Initialize(); |
| 1832 } | 1887 } |
| 1833 | 1888 |
| 1834 void TearDown() override { | 1889 void TearDown() override { |
| 1835 texture_manager2_->Destroy(false); | 1890 texture_manager2_->Destroy(false); |
| 1836 texture_manager2_.reset(); | 1891 texture_manager2_.reset(); |
| 1837 texture_manager1_->Destroy(false); | 1892 texture_manager1_->Destroy(false); |
| 1838 texture_manager1_.reset(); | 1893 texture_manager1_.reset(); |
| 1839 GpuServiceTest::TearDown(); | 1894 GpuServiceTest::TearDown(); |
| 1840 } | 1895 } |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2065 texture_manager2_->RemoveTexture(20); | 2120 texture_manager2_->RemoveTexture(20); |
| 2066 } | 2121 } |
| 2067 | 2122 |
| 2068 | 2123 |
| 2069 class TextureFormatTypeValidationTest : public TextureManagerTest { | 2124 class TextureFormatTypeValidationTest : public TextureManagerTest { |
| 2070 public: | 2125 public: |
| 2071 TextureFormatTypeValidationTest() {} | 2126 TextureFormatTypeValidationTest() {} |
| 2072 ~TextureFormatTypeValidationTest() override {} | 2127 ~TextureFormatTypeValidationTest() override {} |
| 2073 | 2128 |
| 2074 protected: | 2129 protected: |
| 2075 void SetupFeatureInfo(const char* gl_extensions, const char* gl_version) { | |
| 2076 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( | |
| 2077 gl_.get(), gl_extensions, "", gl_version); | |
| 2078 feature_info_->Initialize(); | |
| 2079 } | |
| 2080 | |
| 2081 void ExpectValid(GLenum format, GLenum type, GLenum internal_format) { | 2130 void ExpectValid(GLenum format, GLenum type, GLenum internal_format) { |
| 2082 EXPECT_TRUE(manager_->ValidateTextureParameters( | 2131 EXPECT_TRUE(manager_->ValidateTextureParameters( |
| 2083 error_state_.get(), "", format, type, internal_format, 0)); | 2132 error_state_.get(), "", format, type, internal_format, 0)); |
| 2084 } | 2133 } |
| 2085 | 2134 |
| 2086 void ExpectInvalid(GLenum format, GLenum type, GLenum internal_format) { | 2135 void ExpectInvalid(GLenum format, GLenum type, GLenum internal_format) { |
| 2087 EXPECT_CALL(*error_state_, | 2136 EXPECT_CALL(*error_state_, |
| 2088 SetGLError(_, _, _, _, _)) | 2137 SetGLError(_, _, _, _, _)) |
| 2089 .Times(1) | 2138 .Times(1) |
| 2090 .RetiresOnSaturation(); | 2139 .RetiresOnSaturation(); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2277 ExpectValid(GL_ALPHA, GL_HALF_FLOAT_OES, GL_ALPHA); | 2326 ExpectValid(GL_ALPHA, GL_HALF_FLOAT_OES, GL_ALPHA); |
| 2278 | 2327 |
| 2279 ExpectInvalidEnum(GL_RGB, GL_FLOAT, GL_RGB); | 2328 ExpectInvalidEnum(GL_RGB, GL_FLOAT, GL_RGB); |
| 2280 ExpectInvalidEnum(GL_RGBA, GL_FLOAT, GL_RGBA); | 2329 ExpectInvalidEnum(GL_RGBA, GL_FLOAT, GL_RGBA); |
| 2281 ExpectInvalidEnum(GL_LUMINANCE, GL_FLOAT, GL_LUMINANCE); | 2330 ExpectInvalidEnum(GL_LUMINANCE, GL_FLOAT, GL_LUMINANCE); |
| 2282 ExpectInvalidEnum(GL_LUMINANCE_ALPHA, GL_FLOAT, GL_LUMINANCE_ALPHA); | 2331 ExpectInvalidEnum(GL_LUMINANCE_ALPHA, GL_FLOAT, GL_LUMINANCE_ALPHA); |
| 2283 ExpectInvalidEnum(GL_ALPHA, GL_FLOAT, GL_ALPHA); | 2332 ExpectInvalidEnum(GL_ALPHA, GL_FLOAT, GL_ALPHA); |
| 2284 } | 2333 } |
| 2285 | 2334 |
| 2286 TEST_F(TextureFormatTypeValidationTest, ES3Basic) { | 2335 TEST_F(TextureFormatTypeValidationTest, ES3Basic) { |
| 2287 SetupFeatureInfo("", "OpenGL ES 3.0"); | 2336 SetupFeatureInfo("", "OpenGL ES 3.0", true); |
| 2288 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS, _)) | |
| 2289 .WillOnce(SetArgPointee<1>(8)) | |
| 2290 .RetiresOnSaturation(); | |
| 2291 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_DRAW_BUFFERS, _)) | |
| 2292 .WillOnce(SetArgPointee<1>(8)) | |
| 2293 .RetiresOnSaturation(); | |
| 2294 feature_info_->EnableES3Validators(); | |
| 2295 | 2337 |
| 2296 ExpectValid(GL_ALPHA, GL_UNSIGNED_BYTE, GL_ALPHA); | 2338 ExpectValid(GL_ALPHA, GL_UNSIGNED_BYTE, GL_ALPHA); |
| 2297 ExpectValid(GL_RGB, GL_UNSIGNED_SHORT_5_6_5, GL_RGB); | 2339 ExpectValid(GL_RGB, GL_UNSIGNED_SHORT_5_6_5, GL_RGB); |
| 2298 ExpectValid(GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, GL_RGBA); | 2340 ExpectValid(GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, GL_RGBA); |
| 2299 ExpectValid(GL_LUMINANCE, GL_UNSIGNED_BYTE, GL_LUMINANCE); | 2341 ExpectValid(GL_LUMINANCE, GL_UNSIGNED_BYTE, GL_LUMINANCE); |
| 2300 ExpectValid(GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, GL_LUMINANCE_ALPHA); | 2342 ExpectValid(GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, GL_LUMINANCE_ALPHA); |
| 2301 | 2343 |
| 2302 ExpectValid(GL_RG, GL_BYTE, GL_RG8_SNORM); | 2344 ExpectValid(GL_RG, GL_BYTE, GL_RG8_SNORM); |
| 2303 ExpectValid(GL_RG_INTEGER, GL_UNSIGNED_INT, GL_RG32UI); | 2345 ExpectValid(GL_RG_INTEGER, GL_UNSIGNED_INT, GL_RG32UI); |
| 2304 ExpectValid(GL_RG_INTEGER, GL_SHORT, GL_RG16I); | 2346 ExpectValid(GL_RG_INTEGER, GL_SHORT, GL_RG16I); |
| 2305 ExpectValid(GL_RGB, GL_UNSIGNED_BYTE, GL_SRGB8); | 2347 ExpectValid(GL_RGB, GL_UNSIGNED_BYTE, GL_SRGB8); |
| 2306 ExpectValid(GL_RGBA, GL_HALF_FLOAT, GL_RGBA16F); | 2348 ExpectValid(GL_RGBA, GL_HALF_FLOAT, GL_RGBA16F); |
| 2307 ExpectValid(GL_RGBA, GL_FLOAT, GL_RGBA16F); | 2349 ExpectValid(GL_RGBA, GL_FLOAT, GL_RGBA16F); |
| 2308 ExpectValid(GL_RGBA, GL_FLOAT, GL_RGBA32F); | 2350 ExpectValid(GL_RGBA, GL_FLOAT, GL_RGBA32F); |
| 2309 | 2351 |
| 2310 ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT16); | 2352 ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT16); |
| 2311 ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT24); | 2353 ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT24); |
| 2312 ExpectValid(GL_DEPTH_COMPONENT, GL_FLOAT, GL_DEPTH_COMPONENT32F); | 2354 ExpectValid(GL_DEPTH_COMPONENT, GL_FLOAT, GL_DEPTH_COMPONENT32F); |
| 2313 ExpectValid(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_DEPTH24_STENCIL8); | 2355 ExpectValid(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_DEPTH24_STENCIL8); |
| 2314 ExpectValid(GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, | 2356 ExpectValid(GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, |
| 2315 GL_DEPTH32F_STENCIL8); | 2357 GL_DEPTH32F_STENCIL8); |
| 2316 | 2358 |
| 2317 ExpectInvalid(GL_RGB_INTEGER, GL_INT, GL_RGBA8); | 2359 ExpectInvalid(GL_RGB_INTEGER, GL_INT, GL_RGBA8); |
| 2318 } | 2360 } |
| 2319 | 2361 |
| 2320 } // namespace gles2 | 2362 } // namespace gles2 |
| 2321 } // namespace gpu | 2363 } // namespace gpu |
| OLD | NEW |