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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 buffer->target(), size, _, usage)) | 593 buffer->target(), size, _, usage)) |
594 .Times(1) | 594 .Times(1) |
595 .RetiresOnSaturation(); | 595 .RetiresOnSaturation(); |
596 } | 596 } |
597 EXPECT_CALL(*error_state, PeekGLError(_, _, _)) | 597 EXPECT_CALL(*error_state, PeekGLError(_, _, _)) |
598 .WillOnce(Return(error)) | 598 .WillOnce(Return(error)) |
599 .RetiresOnSaturation(); | 599 .RetiresOnSaturation(); |
600 manager->DoBufferData(error_state, buffer, size, usage, data); | 600 manager->DoBufferData(error_state, buffer, size, usage, data); |
601 } | 601 } |
602 | 602 |
603 void TestHelper::SetTexParameterWithExpectations( | 603 void TestHelper::SetTexParameteriWithExpectations( |
604 ::gfx::MockGLInterface* gl, MockErrorState* error_state, | 604 ::gfx::MockGLInterface* gl, MockErrorState* error_state, |
605 TextureManager* manager, TextureRef* texture_ref, | 605 TextureManager* manager, TextureRef* texture_ref, |
606 GLenum pname, GLint value, GLenum error) { | 606 GLenum pname, GLint value, GLenum error) { |
607 if (error == GL_NO_ERROR) { | 607 if (error == GL_NO_ERROR) { |
608 if (pname != GL_TEXTURE_POOL_CHROMIUM) { | 608 if (pname != GL_TEXTURE_POOL_CHROMIUM) { |
609 EXPECT_CALL(*gl, TexParameteri(texture_ref->texture()->target(), | 609 EXPECT_CALL(*gl, TexParameteri(texture_ref->texture()->target(), |
610 pname, value)) | 610 pname, value)) |
611 .Times(1) | 611 .Times(1) |
612 .RetiresOnSaturation(); | 612 .RetiresOnSaturation(); |
613 } | 613 } |
614 } else if (error == GL_INVALID_ENUM) { | 614 } else if (error == GL_INVALID_ENUM) { |
615 EXPECT_CALL(*error_state, SetGLErrorInvalidEnum(_, _, _, value, _)) | 615 EXPECT_CALL(*error_state, SetGLErrorInvalidEnum(_, _, _, value, _)) |
616 .Times(1) | 616 .Times(1) |
617 .RetiresOnSaturation(); | 617 .RetiresOnSaturation(); |
618 } else { | 618 } else { |
619 EXPECT_CALL(*error_state, SetGLErrorInvalidParam(_, _, error, _, _, _)) | 619 EXPECT_CALL(*error_state, SetGLErrorInvalidParami(_, _, error, _, _, _)) |
620 .Times(1) | 620 .Times(1) |
621 .RetiresOnSaturation(); | 621 .RetiresOnSaturation(); |
622 } | 622 } |
623 manager->SetParameter("", error_state, texture_ref, pname, value); | 623 manager->SetParameteri("", error_state, texture_ref, pname, value); |
624 } | 624 } |
625 | 625 |
626 ScopedGLImplementationSetter::ScopedGLImplementationSetter( | 626 ScopedGLImplementationSetter::ScopedGLImplementationSetter( |
627 gfx::GLImplementation implementation) | 627 gfx::GLImplementation implementation) |
628 : old_implementation_(gfx::GetGLImplementation()) { | 628 : old_implementation_(gfx::GetGLImplementation()) { |
629 gfx::SetGLImplementation(implementation); | 629 gfx::SetGLImplementation(implementation); |
630 } | 630 } |
631 | 631 |
632 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() { | 632 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() { |
633 gfx::SetGLImplementation(old_implementation_); | 633 gfx::SetGLImplementation(old_implementation_); |
634 } | 634 } |
635 | 635 |
636 } // namespace gles2 | 636 } // namespace gles2 |
637 } // namespace gpu | 637 } // namespace gpu |
638 | 638 |
OLD | NEW |