| 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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  516         .RetiresOnSaturation(); |  516         .RetiresOnSaturation(); | 
|  517   } |  517   } | 
|  518   EXPECT_CALL(*error_state, PeekGLError(_, _, _)) |  518   EXPECT_CALL(*error_state, PeekGLError(_, _, _)) | 
|  519       .WillOnce(Return(error)) |  519       .WillOnce(Return(error)) | 
|  520       .RetiresOnSaturation(); |  520       .RetiresOnSaturation(); | 
|  521   manager->DoBufferData(error_state, buffer, size, usage, data); |  521   manager->DoBufferData(error_state, buffer, size, usage, data); | 
|  522 } |  522 } | 
|  523  |  523  | 
|  524 void TestHelper::SetTexParameterWithExpectations( |  524 void TestHelper::SetTexParameterWithExpectations( | 
|  525     ::gfx::MockGLInterface* gl, MockErrorState* error_state, |  525     ::gfx::MockGLInterface* gl, MockErrorState* error_state, | 
|  526     TextureManager* manager, Texture* texture, |  526     TextureManager* manager, TextureRef* texture_ref, | 
|  527     GLenum pname, GLint value, GLenum error) { |  527     GLenum pname, GLint value, GLenum error) { | 
|  528   if (error == GL_NO_ERROR) { |  528   if (error == GL_NO_ERROR) { | 
|  529     if (pname != GL_TEXTURE_POOL_CHROMIUM) { |  529     if (pname != GL_TEXTURE_POOL_CHROMIUM) { | 
|  530       EXPECT_CALL(*gl, TexParameteri(texture->target(), pname, value)) |  530       EXPECT_CALL(*gl, TexParameteri(texture_ref->texture()->target(), | 
 |  531                                      pname, value)) | 
|  531           .Times(1) |  532           .Times(1) | 
|  532           .RetiresOnSaturation(); |  533           .RetiresOnSaturation(); | 
|  533     } |  534     } | 
|  534   } else if (error == GL_INVALID_ENUM) { |  535   } else if (error == GL_INVALID_ENUM) { | 
|  535     EXPECT_CALL(*error_state, SetGLErrorInvalidEnum(_, _, _, value, _)) |  536     EXPECT_CALL(*error_state, SetGLErrorInvalidEnum(_, _, _, value, _)) | 
|  536         .Times(1) |  537         .Times(1) | 
|  537         .RetiresOnSaturation(); |  538         .RetiresOnSaturation(); | 
|  538   } else { |  539   } else { | 
|  539     EXPECT_CALL(*error_state, SetGLErrorInvalidParam(_, _, error, _, _, _)) |  540     EXPECT_CALL(*error_state, SetGLErrorInvalidParam(_, _, error, _, _, _)) | 
|  540         .Times(1) |  541         .Times(1) | 
|  541         .RetiresOnSaturation(); |  542         .RetiresOnSaturation(); | 
|  542   } |  543   } | 
|  543   manager->SetParameter("", error_state, texture, pname, value); |  544   manager->SetParameter("", error_state, texture_ref, pname, value); | 
|  544 } |  545 } | 
|  545  |  546  | 
|  546 ScopedGLImplementationSetter::ScopedGLImplementationSetter( |  547 ScopedGLImplementationSetter::ScopedGLImplementationSetter( | 
|  547     gfx::GLImplementation implementation) |  548     gfx::GLImplementation implementation) | 
|  548     : old_implementation_(gfx::GetGLImplementation()) { |  549     : old_implementation_(gfx::GetGLImplementation()) { | 
|  549   gfx::SetGLImplementation(implementation); |  550   gfx::SetGLImplementation(implementation); | 
|  550 } |  551 } | 
|  551  |  552  | 
|  552 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() { |  553 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() { | 
|  553   gfx::SetGLImplementation(old_implementation_); |  554   gfx::SetGLImplementation(old_implementation_); | 
|  554 } |  555 } | 
|  555  |  556  | 
|  556 }  // namespace gles2 |  557 }  // namespace gles2 | 
|  557 }  // namespace gpu |  558 }  // namespace gpu | 
|  558  |  559  | 
| OLD | NEW |