| 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 #ifndef GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ |
| 7 | 7 |
| 8 #include "gpu/command_buffer/service/shader_translator.h" | 8 #include "gpu/command_buffer/service/shader_translator.h" |
| 9 #include "ui/gl/gl_implementation.h" | 9 #include "ui/gl/gl_implementation.h" |
| 10 #include "ui/gl/gl_mock.h" | 10 #include "ui/gl/gl_mock.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 static void SetTexParameteriWithExpectations( | 107 static void SetTexParameteriWithExpectations( |
| 108 ::gfx::MockGLInterface* gl, MockErrorState* error_state, | 108 ::gfx::MockGLInterface* gl, MockErrorState* error_state, |
| 109 TextureManager* manager, TextureRef* texture_ref, | 109 TextureManager* manager, TextureRef* texture_ref, |
| 110 GLenum pname, GLint value, GLenum error); | 110 GLenum pname, GLint value, GLenum error); |
| 111 | 111 |
| 112 static void SetShaderStates( | 112 static void SetShaderStates( |
| 113 ::gfx::MockGLInterface* gl, Shader* shader, | 113 ::gfx::MockGLInterface* gl, Shader* shader, |
| 114 bool expected_valid, | 114 bool expected_valid, |
| 115 const std::string* const expected_log_info, | 115 const std::string* const expected_log_info, |
| 116 const std::string* const expected_translated_source, | 116 const std::string* const expected_translated_source, |
| 117 const ShaderTranslatorInterface::VariableMap* const expected_attrib_map, | 117 const AttributeMap* const expected_attrib_map, |
| 118 const ShaderTranslatorInterface::VariableMap* const expected_uniform_map, | 118 const UniformMap* const expected_uniform_map, |
| 119 const ShaderTranslatorInterface::VariableMap* const expected_varying_map, | 119 const VaryingMap* const expected_varying_map, |
| 120 const ShaderTranslatorInterface::NameMap* const expected_name_map); | 120 const NameMap* const expected_name_map); |
| 121 | 121 |
| 122 static void SetShaderStates( | 122 static void SetShaderStates( |
| 123 ::gfx::MockGLInterface* gl, Shader* shader, bool valid); | 123 ::gfx::MockGLInterface* gl, Shader* shader, bool valid); |
| 124 | 124 |
| 125 static sh::Attribute ConstructAttribute( |
| 126 GLenum type, GLint array_size, GLenum precision, |
| 127 bool static_use, const std::string& name); |
| 128 static sh::Uniform ConstructUniform( |
| 129 GLenum type, GLint array_size, GLenum precision, |
| 130 bool static_use, const std::string& name); |
| 131 static sh::Varying ConstructVarying( |
| 132 GLenum type, GLint array_size, GLenum precision, |
| 133 bool static_use, const std::string& name); |
| 134 |
| 125 private: | 135 private: |
| 126 static void SetupTextureInitializationExpectations(::gfx::MockGLInterface* gl, | 136 static void SetupTextureInitializationExpectations(::gfx::MockGLInterface* gl, |
| 127 GLenum target, | 137 GLenum target, |
| 128 bool use_default_textures); | 138 bool use_default_textures); |
| 129 static void SetupTextureDestructionExpectations(::gfx::MockGLInterface* gl, | 139 static void SetupTextureDestructionExpectations(::gfx::MockGLInterface* gl, |
| 130 GLenum target, | 140 GLenum target, |
| 131 bool use_default_textures); | 141 bool use_default_textures); |
| 132 }; | 142 }; |
| 133 | 143 |
| 134 // This object temporaritly Sets what gfx::GetGLImplementation returns. During | 144 // This object temporaritly Sets what gfx::GetGLImplementation returns. During |
| 135 // testing the GLImplementation is set to kGLImplemenationMockGL but lots of | 145 // testing the GLImplementation is set to kGLImplemenationMockGL but lots of |
| 136 // code branches based on what gfx::GetGLImplementation returns. | 146 // code branches based on what gfx::GetGLImplementation returns. |
| 137 class ScopedGLImplementationSetter { | 147 class ScopedGLImplementationSetter { |
| 138 public: | 148 public: |
| 139 explicit ScopedGLImplementationSetter(gfx::GLImplementation implementation); | 149 explicit ScopedGLImplementationSetter(gfx::GLImplementation implementation); |
| 140 ~ScopedGLImplementationSetter(); | 150 ~ScopedGLImplementationSetter(); |
| 141 | 151 |
| 142 private: | 152 private: |
| 143 gfx::GLImplementation old_implementation_; | 153 gfx::GLImplementation old_implementation_; |
| 144 }; | 154 }; |
| 145 | 155 |
| 146 } // namespace gles2 | 156 } // namespace gles2 |
| 147 } // namespace gpu | 157 } // namespace gpu |
| 148 | 158 |
| 149 #endif // GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ | 159 #endif // GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ |
| 150 | 160 |
| OLD | NEW |