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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 void TestHelper::SetupContextGroupInitExpectations( | 263 void TestHelper::SetupContextGroupInitExpectations( |
264 ::gfx::MockGLInterface* gl, | 264 ::gfx::MockGLInterface* gl, |
265 const DisallowedFeatures& disallowed_features, | 265 const DisallowedFeatures& disallowed_features, |
266 const char* extensions, | 266 const char* extensions, |
267 const char* gl_version, | 267 const char* gl_version, |
268 bool bind_generates_resource) { | 268 bool bind_generates_resource) { |
269 InSequence sequence; | 269 InSequence sequence; |
270 | 270 |
271 SetupFeatureInfoInitExpectationsWithGLVersion(gl, extensions, "", gl_version); | 271 SetupFeatureInfoInitExpectationsWithGLVersion(gl, extensions, "", gl_version); |
272 | 272 |
273 std::string l_version(base::StringToLowerASCII(std::string(gl_version))); | 273 std::string l_version(base::ToLowerASCII(std::string(gl_version))); |
274 bool is_es3 = (l_version.substr(0, 12) == "opengl es 3."); | 274 bool is_es3 = (l_version.substr(0, 12) == "opengl es 3."); |
275 | 275 |
276 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_RENDERBUFFER_SIZE, _)) | 276 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_RENDERBUFFER_SIZE, _)) |
277 .WillOnce(SetArgumentPointee<1>(kMaxRenderbufferSize)) | 277 .WillOnce(SetArgumentPointee<1>(kMaxRenderbufferSize)) |
278 .RetiresOnSaturation(); | 278 .RetiresOnSaturation(); |
279 if (strstr(extensions, "GL_EXT_framebuffer_multisample") || | 279 if (strstr(extensions, "GL_EXT_framebuffer_multisample") || |
280 strstr(extensions, "GL_EXT_multisampled_render_to_texture") || is_es3) { | 280 strstr(extensions, "GL_EXT_multisampled_render_to_texture") || is_es3) { |
281 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_SAMPLES, _)) | 281 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_SAMPLES, _)) |
282 .WillOnce(SetArgumentPointee<1>(kMaxSamples)) | 282 .WillOnce(SetArgumentPointee<1>(kMaxSamples)) |
283 .RetiresOnSaturation(); | 283 .RetiresOnSaturation(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 EXPECT_CALL(*gl, GetString(GL_EXTENSIONS)) | 338 EXPECT_CALL(*gl, GetString(GL_EXTENSIONS)) |
339 .WillOnce(Return(reinterpret_cast<const uint8*>(extensions))) | 339 .WillOnce(Return(reinterpret_cast<const uint8*>(extensions))) |
340 .RetiresOnSaturation(); | 340 .RetiresOnSaturation(); |
341 EXPECT_CALL(*gl, GetString(GL_RENDERER)) | 341 EXPECT_CALL(*gl, GetString(GL_RENDERER)) |
342 .WillOnce(Return(reinterpret_cast<const uint8*>(gl_renderer))) | 342 .WillOnce(Return(reinterpret_cast<const uint8*>(gl_renderer))) |
343 .RetiresOnSaturation(); | 343 .RetiresOnSaturation(); |
344 EXPECT_CALL(*gl, GetString(GL_VERSION)) | 344 EXPECT_CALL(*gl, GetString(GL_VERSION)) |
345 .WillOnce(Return(reinterpret_cast<const uint8*>(gl_version))) | 345 .WillOnce(Return(reinterpret_cast<const uint8*>(gl_version))) |
346 .RetiresOnSaturation(); | 346 .RetiresOnSaturation(); |
347 | 347 |
348 std::string l_version(base::StringToLowerASCII(std::string(gl_version))); | 348 std::string l_version(base::ToLowerASCII(std::string(gl_version))); |
349 bool is_es3 = (l_version.substr(0, 12) == "opengl es 3."); | 349 bool is_es3 = (l_version.substr(0, 12) == "opengl es 3."); |
350 | 350 |
351 if (strstr(extensions, "GL_ARB_texture_float") || | 351 if (strstr(extensions, "GL_ARB_texture_float") || |
352 (is_es3 && strstr(extensions, "GL_EXT_color_buffer_float"))) { | 352 (is_es3 && strstr(extensions, "GL_EXT_color_buffer_float"))) { |
353 static const GLuint tx_ids[] = {101, 102}; | 353 static const GLuint tx_ids[] = {101, 102}; |
354 static const GLuint fb_ids[] = {103, 104}; | 354 static const GLuint fb_ids[] = {103, 104}; |
355 const GLsizei width = 16; | 355 const GLsizei width = 16; |
356 EXPECT_CALL(*gl, GetIntegerv(GL_FRAMEBUFFER_BINDING, _)) | 356 EXPECT_CALL(*gl, GetIntegerv(GL_FRAMEBUFFER_BINDING, _)) |
357 .WillOnce(SetArgumentPointee<1>(fb_ids[0])) | 357 .WillOnce(SetArgumentPointee<1>(fb_ids[0])) |
358 .RetiresOnSaturation(); | 358 .RetiresOnSaturation(); |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 gfx::SetGLImplementation(implementation); | 831 gfx::SetGLImplementation(implementation); |
832 } | 832 } |
833 | 833 |
834 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() { | 834 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() { |
835 gfx::SetGLImplementation(old_implementation_); | 835 gfx::SetGLImplementation(old_implementation_); |
836 } | 836 } |
837 | 837 |
838 } // namespace gles2 | 838 } // namespace gles2 |
839 } // namespace gpu | 839 } // namespace gpu |
840 | 840 |
OLD | NEW |