Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: gpu/command_buffer/service/test_helper.cc

Issue 2022983003: Roll base to 5e00da80f6adb7082d1c0e88d3274cf87cc43bc5 and tonic to f7acabb8fa6c91124486a41194eac3cd… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/command_buffer/service/gpu_tracer.cc ('k') | gpu/config/gpu_control_list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gpu_tracer.cc ('k') | gpu/config/gpu_control_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698