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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 278 |
279 void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( | 279 void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( |
280 ::gfx::MockGLInterface* gl, | 280 ::gfx::MockGLInterface* gl, |
281 const char* extensions, | 281 const char* extensions, |
282 const char* version) { | 282 const char* version) { |
283 InSequence sequence; | 283 InSequence sequence; |
284 | 284 |
285 EXPECT_CALL(*gl, GetString(GL_EXTENSIONS)) | 285 EXPECT_CALL(*gl, GetString(GL_EXTENSIONS)) |
286 .WillOnce(Return(reinterpret_cast<const uint8*>(extensions))) | 286 .WillOnce(Return(reinterpret_cast<const uint8*>(extensions))) |
287 .RetiresOnSaturation(); | 287 .RetiresOnSaturation(); |
288 EXPECT_CALL(*gl, GetString(GL_VENDOR)) | |
289 .WillOnce(Return(reinterpret_cast<const uint8*>(""))) | |
290 .RetiresOnSaturation(); | |
291 EXPECT_CALL(*gl, GetString(GL_RENDERER)) | |
292 .WillOnce(Return(reinterpret_cast<const uint8*>(""))) | |
293 .RetiresOnSaturation(); | |
294 EXPECT_CALL(*gl, GetString(GL_VERSION)) | 288 EXPECT_CALL(*gl, GetString(GL_VERSION)) |
295 .WillOnce(Return(reinterpret_cast<const uint8*>(version))) | 289 .WillOnce(Return(reinterpret_cast<const uint8*>(version))) |
296 .RetiresOnSaturation(); | 290 .RetiresOnSaturation(); |
297 } | 291 } |
298 | 292 |
299 void TestHelper::SetupExpectationsForClearingUniforms( | 293 void TestHelper::SetupExpectationsForClearingUniforms( |
300 ::gfx::MockGLInterface* gl, UniformInfo* uniforms, size_t num_uniforms) { | 294 ::gfx::MockGLInterface* gl, UniformInfo* uniforms, size_t num_uniforms) { |
301 for (size_t ii = 0; ii < num_uniforms; ++ii) { | 295 for (size_t ii = 0; ii < num_uniforms; ++ii) { |
302 const UniformInfo& info = uniforms[ii]; | 296 const UniformInfo& info = uniforms[ii]; |
303 switch (info.type) { | 297 switch (info.type) { |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 gfx::SetGLImplementation(implementation); | 544 gfx::SetGLImplementation(implementation); |
551 } | 545 } |
552 | 546 |
553 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() { | 547 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() { |
554 gfx::SetGLImplementation(old_implementation_); | 548 gfx::SetGLImplementation(old_implementation_); |
555 } | 549 } |
556 | 550 |
557 } // namespace gles2 | 551 } // namespace gles2 |
558 } // namespace gpu | 552 } // namespace gpu |
559 | 553 |
OLD | NEW |