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

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

Issue 640283003: Use NV_draw_buffers to implement EXT_draw_buffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 6 years, 2 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
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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 .RetiresOnSaturation(); 385 .RetiresOnSaturation();
386 EXPECT_CALL(*gl, BindTexture(GL_TEXTURE_2D, gl_ids[0])) 386 EXPECT_CALL(*gl, BindTexture(GL_TEXTURE_2D, gl_ids[0]))
387 .Times(1) 387 .Times(1)
388 .RetiresOnSaturation(); 388 .RetiresOnSaturation();
389 #if DCHECK_IS_ON 389 #if DCHECK_IS_ON
390 EXPECT_CALL(*gl, GetError()) 390 EXPECT_CALL(*gl, GetError())
391 .WillOnce(Return(GL_NO_ERROR)) 391 .WillOnce(Return(GL_NO_ERROR))
392 .RetiresOnSaturation(); 392 .RetiresOnSaturation();
393 #endif 393 #endif
394 } 394 }
395
396 if (strstr(extensions, "GL_EXT_draw_buffers") ||
397 strstr(extensions, "GL_ARB_draw_buffers") ||
398 (is_es3 && strstr(extensions, "GL_NV_draw_buffers"))) {
399 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, _))
400 .WillOnce(SetArgumentPointee<1>(8))
401 .RetiresOnSaturation();
402 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, _))
403 .WillOnce(SetArgumentPointee<1>(8))
404 .RetiresOnSaturation();
405 }
395 } 406 }
396 407
397 void TestHelper::SetupExpectationsForClearingUniforms( 408 void TestHelper::SetupExpectationsForClearingUniforms(
398 ::gfx::MockGLInterface* gl, UniformInfo* uniforms, size_t num_uniforms) { 409 ::gfx::MockGLInterface* gl, UniformInfo* uniforms, size_t num_uniforms) {
399 for (size_t ii = 0; ii < num_uniforms; ++ii) { 410 for (size_t ii = 0; ii < num_uniforms; ++ii) {
400 const UniformInfo& info = uniforms[ii]; 411 const UniformInfo& info = uniforms[ii];
401 switch (info.type) { 412 switch (info.type) {
402 case GL_FLOAT: 413 case GL_FLOAT:
403 EXPECT_CALL(*gl, Uniform1fv(info.real_location, info.size, _)) 414 EXPECT_CALL(*gl, Uniform1fv(info.real_location, info.size, _))
404 .Times(1) 415 .Times(1)
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 gfx::SetGLImplementation(implementation); 731 gfx::SetGLImplementation(implementation);
721 } 732 }
722 733
723 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() { 734 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() {
724 gfx::SetGLImplementation(old_implementation_); 735 gfx::SetGLImplementation(old_implementation_);
725 } 736 }
726 737
727 } // namespace gles2 738 } // namespace gles2
728 } // namespace gpu 739 } // namespace gpu
729 740
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698