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

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

Issue 1309743005: command_buffer: Implement EXT_blend_func_extended (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new-05-path-fragment-input-gen
Patch Set: address review comments Created 5 years, 3 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 #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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 }; 75 };
76 76
77 struct VaryingInfo { 77 struct VaryingInfo {
78 const char* name; 78 const char* name;
79 GLint size; 79 GLint size;
80 GLenum type; 80 GLenum type;
81 GLint fake_location; 81 GLint fake_location;
82 GLint real_location; 82 GLint real_location;
83 GLint desired_location; 83 GLint desired_location;
84 }; 84 };
85 struct ProgramOutputInfo {
86 const char* name;
87 GLint size;
88 GLenum type;
89 GLint color_name;
90 GLuint index;
91 };
85 92
86 static void SetupContextGroupInitExpectations( 93 static void SetupContextGroupInitExpectations(
87 ::gfx::MockGLInterface* gl, 94 ::gfx::MockGLInterface* gl,
88 const DisallowedFeatures& disallowed_features, 95 const DisallowedFeatures& disallowed_features,
89 const char* extensions, 96 const char* extensions,
90 const char* gl_version, 97 const char* gl_version,
91 bool bind_generates_resource); 98 bool bind_generates_resource);
92 static void SetupFeatureInfoInitExpectations( 99 static void SetupFeatureInfoInitExpectations(
93 ::gfx::MockGLInterface* gl, const char* extensions); 100 ::gfx::MockGLInterface* gl, const char* extensions);
94 static void SetupFeatureInfoInitExpectationsWithGLVersion( 101 static void SetupFeatureInfoInitExpectationsWithGLVersion(
(...skipping 24 matching lines...) Expand all
119 126
120 static void SetupShaderExpectationsWithVaryings( 127 static void SetupShaderExpectationsWithVaryings(
121 ::gfx::MockGLInterface* gl, 128 ::gfx::MockGLInterface* gl,
122 const FeatureInfo* feature_info, 129 const FeatureInfo* feature_info,
123 AttribInfo* attribs, 130 AttribInfo* attribs,
124 size_t num_attribs, 131 size_t num_attribs,
125 UniformInfo* uniforms, 132 UniformInfo* uniforms,
126 size_t num_uniforms, 133 size_t num_uniforms,
127 VaryingInfo* varyings, 134 VaryingInfo* varyings,
128 size_t num_varyings, 135 size_t num_varyings,
136 ProgramOutputInfo* program_outputs,
137 size_t num_program_outputs,
129 GLuint service_id); 138 GLuint service_id);
130 139
131 static void SetupProgramSuccessExpectations(::gfx::MockGLInterface* gl, 140 static void SetupProgramSuccessExpectations(
132 const FeatureInfo* feature_info, 141 ::gfx::MockGLInterface* gl,
133 AttribInfo* attribs, 142 const FeatureInfo* feature_info,
134 size_t num_attribs, 143 AttribInfo* attribs,
135 UniformInfo* uniforms, 144 size_t num_attribs,
136 size_t num_uniforms, 145 UniformInfo* uniforms,
137 VaryingInfo* varyings, 146 size_t num_uniforms,
138 size_t num_varyings, 147 VaryingInfo* varyings,
139 GLuint service_id); 148 size_t num_varyings,
149 ProgramOutputInfo* program_outputs,
150 size_t num_program_outputs,
151 GLuint service_id);
140 152
141 static void DoBufferData( 153 static void DoBufferData(
142 ::gfx::MockGLInterface* gl, MockErrorState* error_state, 154 ::gfx::MockGLInterface* gl, MockErrorState* error_state,
143 BufferManager* manager, Buffer* buffer, GLenum target, GLsizeiptr size, 155 BufferManager* manager, Buffer* buffer, GLenum target, GLsizeiptr size,
144 GLenum usage, const GLvoid* data, GLenum error); 156 GLenum usage, const GLvoid* data, GLenum error);
145 157
146 static void SetTexParameteriWithExpectations( 158 static void SetTexParameteriWithExpectations(
147 ::gfx::MockGLInterface* gl, MockErrorState* error_state, 159 ::gfx::MockGLInterface* gl, MockErrorState* error_state,
148 TextureManager* manager, TextureRef* texture_ref, 160 TextureManager* manager, TextureRef* texture_ref,
149 GLenum pname, GLint value, GLenum error); 161 GLenum pname, GLint value, GLenum error);
150 162
151 static void SetShaderStates( 163 static void SetShaderStates(
152 ::gfx::MockGLInterface* gl, Shader* shader, 164 ::gfx::MockGLInterface* gl,
165 Shader* shader,
153 bool expected_valid, 166 bool expected_valid,
154 const std::string* const expected_log_info, 167 const std::string* const expected_log_info,
155 const std::string* const expected_translated_source, 168 const std::string* const expected_translated_source,
156 const int* const expected_shader_version, 169 const int* const expected_shader_version,
157 const AttributeMap* const expected_attrib_map, 170 const AttributeMap* const expected_attrib_map,
158 const UniformMap* const expected_uniform_map, 171 const UniformMap* const expected_uniform_map,
159 const VaryingMap* const expected_varying_map, 172 const VaryingMap* const expected_varying_map,
173 const OutputVariableList* const expected_output_variable_list,
160 const NameMap* const expected_name_map); 174 const NameMap* const expected_name_map);
161 175
162 static void SetShaderStates( 176 static void SetShaderStates(
163 ::gfx::MockGLInterface* gl, Shader* shader, bool valid); 177 ::gfx::MockGLInterface* gl, Shader* shader, bool valid);
164 178
165 static sh::Attribute ConstructAttribute( 179 static sh::Attribute ConstructAttribute(
166 GLenum type, GLint array_size, GLenum precision, 180 GLenum type, GLint array_size, GLenum precision,
167 bool static_use, const std::string& name); 181 bool static_use, const std::string& name);
168 static sh::Uniform ConstructUniform( 182 static sh::Uniform ConstructUniform(
169 GLenum type, GLint array_size, GLenum precision, 183 GLenum type, GLint array_size, GLenum precision,
170 bool static_use, const std::string& name); 184 bool static_use, const std::string& name);
171 static sh::Varying ConstructVarying( 185 static sh::Varying ConstructVarying(
172 GLenum type, GLint array_size, GLenum precision, 186 GLenum type, GLint array_size, GLenum precision,
173 bool static_use, const std::string& name); 187 bool static_use, const std::string& name);
188 static sh::OutputVariable ConstructOutputVariable(GLenum type,
189 GLint array_size,
190 GLenum precision,
191 bool static_use,
192 const std::string& name);
174 193
175 private: 194 private:
176 static void SetupTextureInitializationExpectations(::gfx::MockGLInterface* gl, 195 static void SetupTextureInitializationExpectations(::gfx::MockGLInterface* gl,
177 GLenum target, 196 GLenum target,
178 bool use_default_textures); 197 bool use_default_textures);
179 static void SetupTextureDestructionExpectations(::gfx::MockGLInterface* gl, 198 static void SetupTextureDestructionExpectations(::gfx::MockGLInterface* gl,
180 GLenum target, 199 GLenum target,
181 bool use_default_textures); 200 bool use_default_textures);
182 201
183 static std::vector<std::string> split_extensions_; 202 static std::vector<std::string> split_extensions_;
184 }; 203 };
185 204
186 // This object temporaritly Sets what gfx::GetGLImplementation returns. During 205 // This object temporaritly Sets what gfx::GetGLImplementation returns. During
187 // testing the GLImplementation is set to kGLImplemenationMockGL but lots of 206 // testing the GLImplementation is set to kGLImplemenationMockGL but lots of
188 // code branches based on what gfx::GetGLImplementation returns. 207 // code branches based on what gfx::GetGLImplementation returns.
189 class ScopedGLImplementationSetter { 208 class ScopedGLImplementationSetter {
190 public: 209 public:
191 explicit ScopedGLImplementationSetter(gfx::GLImplementation implementation); 210 explicit ScopedGLImplementationSetter(gfx::GLImplementation implementation);
192 ~ScopedGLImplementationSetter(); 211 ~ScopedGLImplementationSetter();
193 212
194 private: 213 private:
195 gfx::GLImplementation old_implementation_; 214 gfx::GLImplementation old_implementation_;
196 }; 215 };
197 216
198 } // namespace gles2 217 } // namespace gles2
199 } // namespace gpu 218 } // namespace gpu
200 219
201 #endif // GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_ 220 #endif // GPU_COMMAND_BUFFER_SERVICE_TEST_HELPER_H_
202 221
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698