| 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/test_helper.h" | 5 #include "gpu/command_buffer/service/test_helper.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 const GLuint TestHelper::kServiceDefaultTextureCubemapId; | 60 const GLuint TestHelper::kServiceDefaultTextureCubemapId; |
| 61 const GLuint TestHelper::kServiceBlackExternalTextureId; | 61 const GLuint TestHelper::kServiceBlackExternalTextureId; |
| 62 const GLuint TestHelper::kServiceDefaultExternalTextureId; | 62 const GLuint TestHelper::kServiceDefaultExternalTextureId; |
| 63 const GLuint TestHelper::kServiceBlackRectangleTextureId; | 63 const GLuint TestHelper::kServiceBlackRectangleTextureId; |
| 64 const GLuint TestHelper::kServiceDefaultRectangleTextureId; | 64 const GLuint TestHelper::kServiceDefaultRectangleTextureId; |
| 65 | 65 |
| 66 const GLint TestHelper::kMaxSamples; | 66 const GLint TestHelper::kMaxSamples; |
| 67 const GLint TestHelper::kMaxRenderbufferSize; | 67 const GLint TestHelper::kMaxRenderbufferSize; |
| 68 const GLint TestHelper::kMaxTextureSize; | 68 const GLint TestHelper::kMaxTextureSize; |
| 69 const GLint TestHelper::kMaxCubeMapTextureSize; | 69 const GLint TestHelper::kMaxCubeMapTextureSize; |
| 70 const GLint TestHelper::kMaxRectangleTextureSize; |
| 70 const GLint TestHelper::kNumVertexAttribs; | 71 const GLint TestHelper::kNumVertexAttribs; |
| 71 const GLint TestHelper::kNumTextureUnits; | 72 const GLint TestHelper::kNumTextureUnits; |
| 72 const GLint TestHelper::kMaxTextureImageUnits; | 73 const GLint TestHelper::kMaxTextureImageUnits; |
| 73 const GLint TestHelper::kMaxVertexTextureImageUnits; | 74 const GLint TestHelper::kMaxVertexTextureImageUnits; |
| 74 const GLint TestHelper::kMaxFragmentUniformVectors; | 75 const GLint TestHelper::kMaxFragmentUniformVectors; |
| 75 const GLint TestHelper::kMaxFragmentUniformComponents; | 76 const GLint TestHelper::kMaxFragmentUniformComponents; |
| 76 const GLint TestHelper::kMaxVaryingVectors; | 77 const GLint TestHelper::kMaxVaryingVectors; |
| 77 const GLint TestHelper::kMaxVaryingFloats; | 78 const GLint TestHelper::kMaxVaryingFloats; |
| 78 const GLint TestHelper::kMaxVertexUniformVectors; | 79 const GLint TestHelper::kMaxVertexUniformVectors; |
| 79 const GLint TestHelper::kMaxVertexUniformComponents; | 80 const GLint TestHelper::kMaxVertexUniformComponents; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 .RetiresOnSaturation(); | 291 .RetiresOnSaturation(); |
| 291 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, _)) | 292 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, _)) |
| 292 .WillOnce(SetArgumentPointee<1>(kNumTextureUnits)) | 293 .WillOnce(SetArgumentPointee<1>(kNumTextureUnits)) |
| 293 .RetiresOnSaturation(); | 294 .RetiresOnSaturation(); |
| 294 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_TEXTURE_SIZE, _)) | 295 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_TEXTURE_SIZE, _)) |
| 295 .WillOnce(SetArgumentPointee<1>(kMaxTextureSize)) | 296 .WillOnce(SetArgumentPointee<1>(kMaxTextureSize)) |
| 296 .RetiresOnSaturation(); | 297 .RetiresOnSaturation(); |
| 297 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, _)) | 298 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, _)) |
| 298 .WillOnce(SetArgumentPointee<1>(kMaxCubeMapTextureSize)) | 299 .WillOnce(SetArgumentPointee<1>(kMaxCubeMapTextureSize)) |
| 299 .RetiresOnSaturation(); | 300 .RetiresOnSaturation(); |
| 301 if (strstr(extensions, "GL_ARB_texture_rectangle")) { |
| 302 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE, _)) |
| 303 .WillOnce(SetArgumentPointee<1>(kMaxRectangleTextureSize)) |
| 304 .RetiresOnSaturation(); |
| 305 } |
| 300 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, _)) | 306 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, _)) |
| 301 .WillOnce(SetArgumentPointee<1>(kMaxTextureImageUnits)) | 307 .WillOnce(SetArgumentPointee<1>(kMaxTextureImageUnits)) |
| 302 .RetiresOnSaturation(); | 308 .RetiresOnSaturation(); |
| 303 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, _)) | 309 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, _)) |
| 304 .WillOnce(SetArgumentPointee<1>(kMaxVertexTextureImageUnits)) | 310 .WillOnce(SetArgumentPointee<1>(kMaxVertexTextureImageUnits)) |
| 305 .RetiresOnSaturation(); | 311 .RetiresOnSaturation(); |
| 306 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, _)) | 312 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, _)) |
| 307 .WillOnce(SetArgumentPointee<1>(kMaxFragmentUniformComponents)) | 313 .WillOnce(SetArgumentPointee<1>(kMaxFragmentUniformComponents)) |
| 308 .RetiresOnSaturation(); | 314 .RetiresOnSaturation(); |
| 309 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_VARYING_FLOATS, _)) | 315 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_VARYING_FLOATS, _)) |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 gfx::SetGLImplementation(implementation); | 829 gfx::SetGLImplementation(implementation); |
| 824 } | 830 } |
| 825 | 831 |
| 826 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() { | 832 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() { |
| 827 gfx::SetGLImplementation(old_implementation_); | 833 gfx::SetGLImplementation(old_implementation_); |
| 828 } | 834 } |
| 829 | 835 |
| 830 } // namespace gles2 | 836 } // namespace gles2 |
| 831 } // namespace gpu | 837 } // namespace gpu |
| 832 | 838 |
| OLD | NEW |