| 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 // This file is auto-generated from | 5 // This file is auto-generated from |
| 6 // gpu/command_buffer/build_gles2_cmd_buffer.py | 6 // gpu/command_buffer/build_gles2_cmd_buffer.py |
| 7 // DO NOT EDIT! | 7 // DO NOT EDIT! |
| 8 | 8 |
| 9 // It is included by context_state.cc | 9 // It is included by context_state.cc |
| 10 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ | 10 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 color_mask_alpha = true; | 45 color_mask_alpha = true; |
| 46 cull_mode = GL_BACK; | 46 cull_mode = GL_BACK; |
| 47 depth_func = GL_LESS; | 47 depth_func = GL_LESS; |
| 48 depth_mask = true; | 48 depth_mask = true; |
| 49 z_near = 0.0f; | 49 z_near = 0.0f; |
| 50 z_far = 1.0f; | 50 z_far = 1.0f; |
| 51 front_face = GL_CCW; | 51 front_face = GL_CCW; |
| 52 hint_generate_mipmap = GL_DONT_CARE; | 52 hint_generate_mipmap = GL_DONT_CARE; |
| 53 hint_fragment_shader_derivative = GL_DONT_CARE; | 53 hint_fragment_shader_derivative = GL_DONT_CARE; |
| 54 line_width = 1.0f; | 54 line_width = 1.0f; |
| 55 pack_alignment = 4; |
| 56 unpack_alignment = 4; |
| 55 polygon_offset_factor = 0.0f; | 57 polygon_offset_factor = 0.0f; |
| 56 polygon_offset_units = 0.0f; | 58 polygon_offset_units = 0.0f; |
| 57 sample_coverage_value = 1.0f; | 59 sample_coverage_value = 1.0f; |
| 58 sample_coverage_invert = false; | 60 sample_coverage_invert = false; |
| 59 scissor_x = 0; | 61 scissor_x = 0; |
| 60 scissor_y = 0; | 62 scissor_y = 0; |
| 61 scissor_width = 1; | 63 scissor_width = 1; |
| 62 scissor_height = 1; | 64 scissor_height = 1; |
| 63 stencil_front_func = GL_ALWAYS; | 65 stencil_front_func = GL_ALWAYS; |
| 64 stencil_front_ref = 0; | 66 stencil_front_ref = 0; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 glCullFace(cull_mode); | 110 glCullFace(cull_mode); |
| 109 glDepthFunc(depth_func); | 111 glDepthFunc(depth_func); |
| 110 glDepthMask(depth_mask); | 112 glDepthMask(depth_mask); |
| 111 glDepthRange(z_near, z_far); | 113 glDepthRange(z_near, z_far); |
| 112 glFrontFace(front_face); | 114 glFrontFace(front_face); |
| 113 glHint(GL_GENERATE_MIPMAP_HINT, hint_generate_mipmap); | 115 glHint(GL_GENERATE_MIPMAP_HINT, hint_generate_mipmap); |
| 114 if (feature_info_->feature_flags().oes_standard_derivatives) | 116 if (feature_info_->feature_flags().oes_standard_derivatives) |
| 115 glHint( | 117 glHint( |
| 116 GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES, hint_fragment_shader_derivative); | 118 GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES, hint_fragment_shader_derivative); |
| 117 glLineWidth(line_width); | 119 glLineWidth(line_width); |
| 120 glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment); |
| 121 glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment); |
| 118 glPolygonOffset(polygon_offset_factor, polygon_offset_units); | 122 glPolygonOffset(polygon_offset_factor, polygon_offset_units); |
| 119 glSampleCoverage(sample_coverage_value, sample_coverage_invert); | 123 glSampleCoverage(sample_coverage_value, sample_coverage_invert); |
| 120 glScissor(scissor_x, scissor_y, scissor_width, scissor_height); | 124 glScissor(scissor_x, scissor_y, scissor_width, scissor_height); |
| 121 glStencilFuncSeparate( | 125 glStencilFuncSeparate( |
| 122 GL_FRONT, stencil_front_func, stencil_front_ref, stencil_front_mask); | 126 GL_FRONT, stencil_front_func, stencil_front_ref, stencil_front_mask); |
| 123 glStencilFuncSeparate( | 127 glStencilFuncSeparate( |
| 124 GL_BACK, stencil_back_func, stencil_back_ref, stencil_back_mask); | 128 GL_BACK, stencil_back_func, stencil_back_ref, stencil_back_mask); |
| 125 glStencilMaskSeparate(GL_FRONT, stencil_front_writemask); | 129 glStencilMaskSeparate(GL_FRONT, stencil_front_writemask); |
| 126 glStencilMaskSeparate(GL_BACK, stencil_back_writemask); | 130 glStencilMaskSeparate(GL_BACK, stencil_back_writemask); |
| 127 glStencilOpSeparate( | 131 glStencilOpSeparate( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 154 return enable_flags.stencil_test; | 158 return enable_flags.stencil_test; |
| 155 default: | 159 default: |
| 156 GPU_NOTREACHED(); | 160 GPU_NOTREACHED(); |
| 157 return false; | 161 return false; |
| 158 } | 162 } |
| 159 } | 163 } |
| 160 | 164 |
| 161 bool ContextState::GetStateAsGLint( | 165 bool ContextState::GetStateAsGLint( |
| 162 GLenum pname, GLint* params, GLsizei* num_written) const { | 166 GLenum pname, GLint* params, GLsizei* num_written) const { |
| 163 switch (pname) { | 167 switch (pname) { |
| 164 case GL_VIEWPORT: | 168 case GL_BLEND_COLOR: |
| 165 *num_written = 4; | 169 *num_written = 4; |
| 166 if (params) { | 170 if (params) { |
| 167 params[0] = static_cast<GLint>(viewport_x); | 171 params[0] = static_cast<GLint>(blend_color_red); |
| 168 params[1] = static_cast<GLint>(viewport_y); | 172 params[1] = static_cast<GLint>(blend_color_green); |
| 169 params[2] = static_cast<GLint>(viewport_width); | 173 params[2] = static_cast<GLint>(blend_color_blue); |
| 170 params[3] = static_cast<GLint>(viewport_height); | 174 params[3] = static_cast<GLint>(blend_color_alpha); |
| 175 } |
| 176 return true; |
| 177 case GL_BLEND_EQUATION_RGB: |
| 178 *num_written = 1; |
| 179 if (params) { |
| 180 params[0] = static_cast<GLint>(blend_equation_rgb); |
| 181 } |
| 182 return true; |
| 183 case GL_BLEND_EQUATION_ALPHA: |
| 184 *num_written = 1; |
| 185 if (params) { |
| 186 params[0] = static_cast<GLint>(blend_equation_alpha); |
| 171 } | 187 } |
| 172 return true; | 188 return true; |
| 173 case GL_BLEND_SRC_RGB: | 189 case GL_BLEND_SRC_RGB: |
| 174 *num_written = 1; | 190 *num_written = 1; |
| 175 if (params) { | 191 if (params) { |
| 176 params[0] = static_cast<GLint>(blend_source_rgb); | 192 params[0] = static_cast<GLint>(blend_source_rgb); |
| 177 } | 193 } |
| 178 return true; | 194 return true; |
| 179 case GL_BLEND_DST_RGB: | 195 case GL_BLEND_DST_RGB: |
| 180 *num_written = 1; | 196 *num_written = 1; |
| 181 if (params) { | 197 if (params) { |
| 182 params[0] = static_cast<GLint>(blend_dest_rgb); | 198 params[0] = static_cast<GLint>(blend_dest_rgb); |
| 183 } | 199 } |
| 184 return true; | 200 return true; |
| 185 case GL_BLEND_SRC_ALPHA: | 201 case GL_BLEND_SRC_ALPHA: |
| 186 *num_written = 1; | 202 *num_written = 1; |
| 187 if (params) { | 203 if (params) { |
| 188 params[0] = static_cast<GLint>(blend_source_alpha); | 204 params[0] = static_cast<GLint>(blend_source_alpha); |
| 189 } | 205 } |
| 190 return true; | 206 return true; |
| 191 case GL_BLEND_DST_ALPHA: | 207 case GL_BLEND_DST_ALPHA: |
| 192 *num_written = 1; | 208 *num_written = 1; |
| 193 if (params) { | 209 if (params) { |
| 194 params[0] = static_cast<GLint>(blend_dest_alpha); | 210 params[0] = static_cast<GLint>(blend_dest_alpha); |
| 195 } | 211 } |
| 196 return true; | 212 return true; |
| 197 case GL_LINE_WIDTH: | 213 case GL_COLOR_CLEAR_VALUE: |
| 214 *num_written = 4; |
| 215 if (params) { |
| 216 params[0] = static_cast<GLint>(color_clear_red); |
| 217 params[1] = static_cast<GLint>(color_clear_green); |
| 218 params[2] = static_cast<GLint>(color_clear_blue); |
| 219 params[3] = static_cast<GLint>(color_clear_alpha); |
| 220 } |
| 221 return true; |
| 222 case GL_DEPTH_CLEAR_VALUE: |
| 198 *num_written = 1; | 223 *num_written = 1; |
| 199 if (params) { | 224 if (params) { |
| 200 params[0] = static_cast<GLint>(line_width); | 225 params[0] = static_cast<GLint>(depth_clear); |
| 201 } | |
| 202 return true; | |
| 203 case GL_BLEND_COLOR: | |
| 204 *num_written = 4; | |
| 205 if (params) { | |
| 206 params[0] = static_cast<GLint>(blend_color_red); | |
| 207 params[1] = static_cast<GLint>(blend_color_green); | |
| 208 params[2] = static_cast<GLint>(blend_color_blue); | |
| 209 params[3] = static_cast<GLint>(blend_color_alpha); | |
| 210 } | 226 } |
| 211 return true; | 227 return true; |
| 212 case GL_STENCIL_CLEAR_VALUE: | 228 case GL_STENCIL_CLEAR_VALUE: |
| 213 *num_written = 1; | 229 *num_written = 1; |
| 214 if (params) { | 230 if (params) { |
| 215 params[0] = static_cast<GLint>(stencil_clear); | 231 params[0] = static_cast<GLint>(stencil_clear); |
| 216 } | 232 } |
| 217 return true; | 233 return true; |
| 218 case GL_GENERATE_MIPMAP_HINT: | |
| 219 *num_written = 1; | |
| 220 if (params) { | |
| 221 params[0] = static_cast<GLint>(hint_generate_mipmap); | |
| 222 } | |
| 223 return true; | |
| 224 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: | |
| 225 *num_written = 1; | |
| 226 if (params) { | |
| 227 params[0] = static_cast<GLint>(hint_fragment_shader_derivative); | |
| 228 } | |
| 229 return true; | |
| 230 case GL_COLOR_WRITEMASK: | 234 case GL_COLOR_WRITEMASK: |
| 231 *num_written = 4; | 235 *num_written = 4; |
| 232 if (params) { | 236 if (params) { |
| 233 params[0] = static_cast<GLint>(color_mask_red); | 237 params[0] = static_cast<GLint>(color_mask_red); |
| 234 params[1] = static_cast<GLint>(color_mask_green); | 238 params[1] = static_cast<GLint>(color_mask_green); |
| 235 params[2] = static_cast<GLint>(color_mask_blue); | 239 params[2] = static_cast<GLint>(color_mask_blue); |
| 236 params[3] = static_cast<GLint>(color_mask_alpha); | 240 params[3] = static_cast<GLint>(color_mask_alpha); |
| 237 } | 241 } |
| 238 return true; | 242 return true; |
| 239 case GL_COLOR_CLEAR_VALUE: | 243 case GL_CULL_FACE_MODE: |
| 240 *num_written = 4; | 244 *num_written = 1; |
| 241 if (params) { | 245 if (params) { |
| 242 params[0] = static_cast<GLint>(color_clear_red); | 246 params[0] = static_cast<GLint>(cull_mode); |
| 243 params[1] = static_cast<GLint>(color_clear_green); | 247 } |
| 244 params[2] = static_cast<GLint>(color_clear_blue); | 248 return true; |
| 245 params[3] = static_cast<GLint>(color_clear_alpha); | 249 case GL_DEPTH_FUNC: |
| 250 *num_written = 1; |
| 251 if (params) { |
| 252 params[0] = static_cast<GLint>(depth_func); |
| 253 } |
| 254 return true; |
| 255 case GL_DEPTH_WRITEMASK: |
| 256 *num_written = 1; |
| 257 if (params) { |
| 258 params[0] = static_cast<GLint>(depth_mask); |
| 246 } | 259 } |
| 247 return true; | 260 return true; |
| 248 case GL_DEPTH_RANGE: | 261 case GL_DEPTH_RANGE: |
| 249 *num_written = 2; | 262 *num_written = 2; |
| 250 if (params) { | 263 if (params) { |
| 251 params[0] = static_cast<GLint>(z_near); | 264 params[0] = static_cast<GLint>(z_near); |
| 252 params[1] = static_cast<GLint>(z_far); | 265 params[1] = static_cast<GLint>(z_far); |
| 253 } | 266 } |
| 254 return true; | 267 return true; |
| 255 case GL_DEPTH_CLEAR_VALUE: | |
| 256 *num_written = 1; | |
| 257 if (params) { | |
| 258 params[0] = static_cast<GLint>(depth_clear); | |
| 259 } | |
| 260 return true; | |
| 261 case GL_STENCIL_FAIL: | |
| 262 *num_written = 1; | |
| 263 if (params) { | |
| 264 params[0] = static_cast<GLint>(stencil_front_fail_op); | |
| 265 } | |
| 266 return true; | |
| 267 case GL_STENCIL_PASS_DEPTH_FAIL: | |
| 268 *num_written = 1; | |
| 269 if (params) { | |
| 270 params[0] = static_cast<GLint>(stencil_front_z_fail_op); | |
| 271 } | |
| 272 return true; | |
| 273 case GL_STENCIL_PASS_DEPTH_PASS: | |
| 274 *num_written = 1; | |
| 275 if (params) { | |
| 276 params[0] = static_cast<GLint>(stencil_front_z_pass_op); | |
| 277 } | |
| 278 return true; | |
| 279 case GL_STENCIL_BACK_FAIL: | |
| 280 *num_written = 1; | |
| 281 if (params) { | |
| 282 params[0] = static_cast<GLint>(stencil_back_fail_op); | |
| 283 } | |
| 284 return true; | |
| 285 case GL_STENCIL_BACK_PASS_DEPTH_FAIL: | |
| 286 *num_written = 1; | |
| 287 if (params) { | |
| 288 params[0] = static_cast<GLint>(stencil_back_z_fail_op); | |
| 289 } | |
| 290 return true; | |
| 291 case GL_STENCIL_BACK_PASS_DEPTH_PASS: | |
| 292 *num_written = 1; | |
| 293 if (params) { | |
| 294 params[0] = static_cast<GLint>(stencil_back_z_pass_op); | |
| 295 } | |
| 296 return true; | |
| 297 case GL_SCISSOR_BOX: | |
| 298 *num_written = 4; | |
| 299 if (params) { | |
| 300 params[0] = static_cast<GLint>(scissor_x); | |
| 301 params[1] = static_cast<GLint>(scissor_y); | |
| 302 params[2] = static_cast<GLint>(scissor_width); | |
| 303 params[3] = static_cast<GLint>(scissor_height); | |
| 304 } | |
| 305 return true; | |
| 306 case GL_FRONT_FACE: | 268 case GL_FRONT_FACE: |
| 307 *num_written = 1; | 269 *num_written = 1; |
| 308 if (params) { | 270 if (params) { |
| 309 params[0] = static_cast<GLint>(front_face); | 271 params[0] = static_cast<GLint>(front_face); |
| 310 } | 272 } |
| 311 return true; | 273 return true; |
| 312 case GL_SAMPLE_COVERAGE_VALUE: | 274 case GL_GENERATE_MIPMAP_HINT: |
| 313 *num_written = 1; | 275 *num_written = 1; |
| 314 if (params) { | 276 if (params) { |
| 315 params[0] = static_cast<GLint>(sample_coverage_value); | 277 params[0] = static_cast<GLint>(hint_generate_mipmap); |
| 316 } | 278 } |
| 317 return true; | 279 return true; |
| 318 case GL_SAMPLE_COVERAGE_INVERT: | 280 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: |
| 319 *num_written = 1; | 281 *num_written = 1; |
| 320 if (params) { | 282 if (params) { |
| 321 params[0] = static_cast<GLint>(sample_coverage_invert); | 283 params[0] = static_cast<GLint>(hint_fragment_shader_derivative); |
| 284 } |
| 285 return true; |
| 286 case GL_LINE_WIDTH: |
| 287 *num_written = 1; |
| 288 if (params) { |
| 289 params[0] = static_cast<GLint>(line_width); |
| 290 } |
| 291 return true; |
| 292 case GL_PACK_ALIGNMENT: |
| 293 *num_written = 1; |
| 294 if (params) { |
| 295 params[0] = static_cast<GLint>(pack_alignment); |
| 296 } |
| 297 return true; |
| 298 case GL_UNPACK_ALIGNMENT: |
| 299 *num_written = 1; |
| 300 if (params) { |
| 301 params[0] = static_cast<GLint>(unpack_alignment); |
| 322 } | 302 } |
| 323 return true; | 303 return true; |
| 324 case GL_POLYGON_OFFSET_FACTOR: | 304 case GL_POLYGON_OFFSET_FACTOR: |
| 325 *num_written = 1; | 305 *num_written = 1; |
| 326 if (params) { | 306 if (params) { |
| 327 params[0] = static_cast<GLint>(polygon_offset_factor); | 307 params[0] = static_cast<GLint>(polygon_offset_factor); |
| 328 } | 308 } |
| 329 return true; | 309 return true; |
| 330 case GL_POLYGON_OFFSET_UNITS: | 310 case GL_POLYGON_OFFSET_UNITS: |
| 331 *num_written = 1; | 311 *num_written = 1; |
| 332 if (params) { | 312 if (params) { |
| 333 params[0] = static_cast<GLint>(polygon_offset_units); | 313 params[0] = static_cast<GLint>(polygon_offset_units); |
| 334 } | 314 } |
| 335 return true; | 315 return true; |
| 336 case GL_CULL_FACE_MODE: | 316 case GL_SAMPLE_COVERAGE_VALUE: |
| 337 *num_written = 1; | 317 *num_written = 1; |
| 338 if (params) { | 318 if (params) { |
| 339 params[0] = static_cast<GLint>(cull_mode); | 319 params[0] = static_cast<GLint>(sample_coverage_value); |
| 340 } | 320 } |
| 341 return true; | 321 return true; |
| 342 case GL_DEPTH_FUNC: | 322 case GL_SAMPLE_COVERAGE_INVERT: |
| 343 *num_written = 1; | 323 *num_written = 1; |
| 344 if (params) { | 324 if (params) { |
| 345 params[0] = static_cast<GLint>(depth_func); | 325 params[0] = static_cast<GLint>(sample_coverage_invert); |
| 326 } |
| 327 return true; |
| 328 case GL_SCISSOR_BOX: |
| 329 *num_written = 4; |
| 330 if (params) { |
| 331 params[0] = static_cast<GLint>(scissor_x); |
| 332 params[1] = static_cast<GLint>(scissor_y); |
| 333 params[2] = static_cast<GLint>(scissor_width); |
| 334 params[3] = static_cast<GLint>(scissor_height); |
| 346 } | 335 } |
| 347 return true; | 336 return true; |
| 348 case GL_STENCIL_FUNC: | 337 case GL_STENCIL_FUNC: |
| 349 *num_written = 1; | 338 *num_written = 1; |
| 350 if (params) { | 339 if (params) { |
| 351 params[0] = static_cast<GLint>(stencil_front_func); | 340 params[0] = static_cast<GLint>(stencil_front_func); |
| 352 } | 341 } |
| 353 return true; | 342 return true; |
| 354 case GL_STENCIL_REF: | 343 case GL_STENCIL_REF: |
| 355 *num_written = 1; | 344 *num_written = 1; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 374 if (params) { | 363 if (params) { |
| 375 params[0] = static_cast<GLint>(stencil_back_ref); | 364 params[0] = static_cast<GLint>(stencil_back_ref); |
| 376 } | 365 } |
| 377 return true; | 366 return true; |
| 378 case GL_STENCIL_BACK_VALUE_MASK: | 367 case GL_STENCIL_BACK_VALUE_MASK: |
| 379 *num_written = 1; | 368 *num_written = 1; |
| 380 if (params) { | 369 if (params) { |
| 381 params[0] = static_cast<GLint>(stencil_back_mask); | 370 params[0] = static_cast<GLint>(stencil_back_mask); |
| 382 } | 371 } |
| 383 return true; | 372 return true; |
| 384 case GL_DEPTH_WRITEMASK: | |
| 385 *num_written = 1; | |
| 386 if (params) { | |
| 387 params[0] = static_cast<GLint>(depth_mask); | |
| 388 } | |
| 389 return true; | |
| 390 case GL_BLEND_EQUATION_RGB: | |
| 391 *num_written = 1; | |
| 392 if (params) { | |
| 393 params[0] = static_cast<GLint>(blend_equation_rgb); | |
| 394 } | |
| 395 return true; | |
| 396 case GL_BLEND_EQUATION_ALPHA: | |
| 397 *num_written = 1; | |
| 398 if (params) { | |
| 399 params[0] = static_cast<GLint>(blend_equation_alpha); | |
| 400 } | |
| 401 return true; | |
| 402 case GL_STENCIL_WRITEMASK: | 373 case GL_STENCIL_WRITEMASK: |
| 403 *num_written = 1; | 374 *num_written = 1; |
| 404 if (params) { | 375 if (params) { |
| 405 params[0] = static_cast<GLint>(stencil_front_writemask); | 376 params[0] = static_cast<GLint>(stencil_front_writemask); |
| 406 } | 377 } |
| 407 return true; | 378 return true; |
| 408 case GL_STENCIL_BACK_WRITEMASK: | 379 case GL_STENCIL_BACK_WRITEMASK: |
| 409 *num_written = 1; | 380 *num_written = 1; |
| 410 if (params) { | 381 if (params) { |
| 411 params[0] = static_cast<GLint>(stencil_back_writemask); | 382 params[0] = static_cast<GLint>(stencil_back_writemask); |
| 412 } | 383 } |
| 413 return true; | 384 return true; |
| 385 case GL_STENCIL_FAIL: |
| 386 *num_written = 1; |
| 387 if (params) { |
| 388 params[0] = static_cast<GLint>(stencil_front_fail_op); |
| 389 } |
| 390 return true; |
| 391 case GL_STENCIL_PASS_DEPTH_FAIL: |
| 392 *num_written = 1; |
| 393 if (params) { |
| 394 params[0] = static_cast<GLint>(stencil_front_z_fail_op); |
| 395 } |
| 396 return true; |
| 397 case GL_STENCIL_PASS_DEPTH_PASS: |
| 398 *num_written = 1; |
| 399 if (params) { |
| 400 params[0] = static_cast<GLint>(stencil_front_z_pass_op); |
| 401 } |
| 402 return true; |
| 403 case GL_STENCIL_BACK_FAIL: |
| 404 *num_written = 1; |
| 405 if (params) { |
| 406 params[0] = static_cast<GLint>(stencil_back_fail_op); |
| 407 } |
| 408 return true; |
| 409 case GL_STENCIL_BACK_PASS_DEPTH_FAIL: |
| 410 *num_written = 1; |
| 411 if (params) { |
| 412 params[0] = static_cast<GLint>(stencil_back_z_fail_op); |
| 413 } |
| 414 return true; |
| 415 case GL_STENCIL_BACK_PASS_DEPTH_PASS: |
| 416 *num_written = 1; |
| 417 if (params) { |
| 418 params[0] = static_cast<GLint>(stencil_back_z_pass_op); |
| 419 } |
| 420 return true; |
| 421 case GL_VIEWPORT: |
| 422 *num_written = 4; |
| 423 if (params) { |
| 424 params[0] = static_cast<GLint>(viewport_x); |
| 425 params[1] = static_cast<GLint>(viewport_y); |
| 426 params[2] = static_cast<GLint>(viewport_width); |
| 427 params[3] = static_cast<GLint>(viewport_height); |
| 428 } |
| 429 return true; |
| 414 case GL_BLEND: | 430 case GL_BLEND: |
| 415 *num_written = 1; | 431 *num_written = 1; |
| 416 if (params) { | 432 if (params) { |
| 417 params[0] = static_cast<GLint>(enable_flags.blend); | 433 params[0] = static_cast<GLint>(enable_flags.blend); |
| 418 } | 434 } |
| 419 return true; | 435 return true; |
| 420 case GL_CULL_FACE: | 436 case GL_CULL_FACE: |
| 421 *num_written = 1; | 437 *num_written = 1; |
| 422 if (params) { | 438 if (params) { |
| 423 params[0] = static_cast<GLint>(enable_flags.cull_face); | 439 params[0] = static_cast<GLint>(enable_flags.cull_face); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 } | 482 } |
| 467 return true; | 483 return true; |
| 468 default: | 484 default: |
| 469 return false; | 485 return false; |
| 470 } | 486 } |
| 471 } | 487 } |
| 472 | 488 |
| 473 bool ContextState::GetStateAsGLfloat( | 489 bool ContextState::GetStateAsGLfloat( |
| 474 GLenum pname, GLfloat* params, GLsizei* num_written) const { | 490 GLenum pname, GLfloat* params, GLsizei* num_written) const { |
| 475 switch (pname) { | 491 switch (pname) { |
| 476 case GL_VIEWPORT: | 492 case GL_BLEND_COLOR: |
| 477 *num_written = 4; | 493 *num_written = 4; |
| 478 if (params) { | 494 if (params) { |
| 479 params[0] = static_cast<GLfloat>(viewport_x); | 495 params[0] = static_cast<GLfloat>(blend_color_red); |
| 480 params[1] = static_cast<GLfloat>(viewport_y); | 496 params[1] = static_cast<GLfloat>(blend_color_green); |
| 481 params[2] = static_cast<GLfloat>(viewport_width); | 497 params[2] = static_cast<GLfloat>(blend_color_blue); |
| 482 params[3] = static_cast<GLfloat>(viewport_height); | 498 params[3] = static_cast<GLfloat>(blend_color_alpha); |
| 499 } |
| 500 return true; |
| 501 case GL_BLEND_EQUATION_RGB: |
| 502 *num_written = 1; |
| 503 if (params) { |
| 504 params[0] = static_cast<GLfloat>(blend_equation_rgb); |
| 505 } |
| 506 return true; |
| 507 case GL_BLEND_EQUATION_ALPHA: |
| 508 *num_written = 1; |
| 509 if (params) { |
| 510 params[0] = static_cast<GLfloat>(blend_equation_alpha); |
| 483 } | 511 } |
| 484 return true; | 512 return true; |
| 485 case GL_BLEND_SRC_RGB: | 513 case GL_BLEND_SRC_RGB: |
| 486 *num_written = 1; | 514 *num_written = 1; |
| 487 if (params) { | 515 if (params) { |
| 488 params[0] = static_cast<GLfloat>(blend_source_rgb); | 516 params[0] = static_cast<GLfloat>(blend_source_rgb); |
| 489 } | 517 } |
| 490 return true; | 518 return true; |
| 491 case GL_BLEND_DST_RGB: | 519 case GL_BLEND_DST_RGB: |
| 492 *num_written = 1; | 520 *num_written = 1; |
| 493 if (params) { | 521 if (params) { |
| 494 params[0] = static_cast<GLfloat>(blend_dest_rgb); | 522 params[0] = static_cast<GLfloat>(blend_dest_rgb); |
| 495 } | 523 } |
| 496 return true; | 524 return true; |
| 497 case GL_BLEND_SRC_ALPHA: | 525 case GL_BLEND_SRC_ALPHA: |
| 498 *num_written = 1; | 526 *num_written = 1; |
| 499 if (params) { | 527 if (params) { |
| 500 params[0] = static_cast<GLfloat>(blend_source_alpha); | 528 params[0] = static_cast<GLfloat>(blend_source_alpha); |
| 501 } | 529 } |
| 502 return true; | 530 return true; |
| 503 case GL_BLEND_DST_ALPHA: | 531 case GL_BLEND_DST_ALPHA: |
| 504 *num_written = 1; | 532 *num_written = 1; |
| 505 if (params) { | 533 if (params) { |
| 506 params[0] = static_cast<GLfloat>(blend_dest_alpha); | 534 params[0] = static_cast<GLfloat>(blend_dest_alpha); |
| 507 } | 535 } |
| 508 return true; | 536 return true; |
| 509 case GL_LINE_WIDTH: | 537 case GL_COLOR_CLEAR_VALUE: |
| 538 *num_written = 4; |
| 539 if (params) { |
| 540 params[0] = static_cast<GLfloat>(color_clear_red); |
| 541 params[1] = static_cast<GLfloat>(color_clear_green); |
| 542 params[2] = static_cast<GLfloat>(color_clear_blue); |
| 543 params[3] = static_cast<GLfloat>(color_clear_alpha); |
| 544 } |
| 545 return true; |
| 546 case GL_DEPTH_CLEAR_VALUE: |
| 510 *num_written = 1; | 547 *num_written = 1; |
| 511 if (params) { | 548 if (params) { |
| 512 params[0] = static_cast<GLfloat>(line_width); | 549 params[0] = static_cast<GLfloat>(depth_clear); |
| 513 } | |
| 514 return true; | |
| 515 case GL_BLEND_COLOR: | |
| 516 *num_written = 4; | |
| 517 if (params) { | |
| 518 params[0] = static_cast<GLfloat>(blend_color_red); | |
| 519 params[1] = static_cast<GLfloat>(blend_color_green); | |
| 520 params[2] = static_cast<GLfloat>(blend_color_blue); | |
| 521 params[3] = static_cast<GLfloat>(blend_color_alpha); | |
| 522 } | 550 } |
| 523 return true; | 551 return true; |
| 524 case GL_STENCIL_CLEAR_VALUE: | 552 case GL_STENCIL_CLEAR_VALUE: |
| 525 *num_written = 1; | 553 *num_written = 1; |
| 526 if (params) { | 554 if (params) { |
| 527 params[0] = static_cast<GLfloat>(stencil_clear); | 555 params[0] = static_cast<GLfloat>(stencil_clear); |
| 528 } | 556 } |
| 529 return true; | 557 return true; |
| 530 case GL_GENERATE_MIPMAP_HINT: | |
| 531 *num_written = 1; | |
| 532 if (params) { | |
| 533 params[0] = static_cast<GLfloat>(hint_generate_mipmap); | |
| 534 } | |
| 535 return true; | |
| 536 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: | |
| 537 *num_written = 1; | |
| 538 if (params) { | |
| 539 params[0] = static_cast<GLfloat>(hint_fragment_shader_derivative); | |
| 540 } | |
| 541 return true; | |
| 542 case GL_COLOR_WRITEMASK: | 558 case GL_COLOR_WRITEMASK: |
| 543 *num_written = 4; | 559 *num_written = 4; |
| 544 if (params) { | 560 if (params) { |
| 545 params[0] = static_cast<GLfloat>(color_mask_red); | 561 params[0] = static_cast<GLfloat>(color_mask_red); |
| 546 params[1] = static_cast<GLfloat>(color_mask_green); | 562 params[1] = static_cast<GLfloat>(color_mask_green); |
| 547 params[2] = static_cast<GLfloat>(color_mask_blue); | 563 params[2] = static_cast<GLfloat>(color_mask_blue); |
| 548 params[3] = static_cast<GLfloat>(color_mask_alpha); | 564 params[3] = static_cast<GLfloat>(color_mask_alpha); |
| 549 } | 565 } |
| 550 return true; | 566 return true; |
| 551 case GL_COLOR_CLEAR_VALUE: | 567 case GL_CULL_FACE_MODE: |
| 552 *num_written = 4; | 568 *num_written = 1; |
| 553 if (params) { | 569 if (params) { |
| 554 params[0] = static_cast<GLfloat>(color_clear_red); | 570 params[0] = static_cast<GLfloat>(cull_mode); |
| 555 params[1] = static_cast<GLfloat>(color_clear_green); | 571 } |
| 556 params[2] = static_cast<GLfloat>(color_clear_blue); | 572 return true; |
| 557 params[3] = static_cast<GLfloat>(color_clear_alpha); | 573 case GL_DEPTH_FUNC: |
| 574 *num_written = 1; |
| 575 if (params) { |
| 576 params[0] = static_cast<GLfloat>(depth_func); |
| 577 } |
| 578 return true; |
| 579 case GL_DEPTH_WRITEMASK: |
| 580 *num_written = 1; |
| 581 if (params) { |
| 582 params[0] = static_cast<GLfloat>(depth_mask); |
| 558 } | 583 } |
| 559 return true; | 584 return true; |
| 560 case GL_DEPTH_RANGE: | 585 case GL_DEPTH_RANGE: |
| 561 *num_written = 2; | 586 *num_written = 2; |
| 562 if (params) { | 587 if (params) { |
| 563 params[0] = static_cast<GLfloat>(z_near); | 588 params[0] = static_cast<GLfloat>(z_near); |
| 564 params[1] = static_cast<GLfloat>(z_far); | 589 params[1] = static_cast<GLfloat>(z_far); |
| 565 } | 590 } |
| 566 return true; | 591 return true; |
| 567 case GL_DEPTH_CLEAR_VALUE: | |
| 568 *num_written = 1; | |
| 569 if (params) { | |
| 570 params[0] = static_cast<GLfloat>(depth_clear); | |
| 571 } | |
| 572 return true; | |
| 573 case GL_STENCIL_FAIL: | |
| 574 *num_written = 1; | |
| 575 if (params) { | |
| 576 params[0] = static_cast<GLfloat>(stencil_front_fail_op); | |
| 577 } | |
| 578 return true; | |
| 579 case GL_STENCIL_PASS_DEPTH_FAIL: | |
| 580 *num_written = 1; | |
| 581 if (params) { | |
| 582 params[0] = static_cast<GLfloat>(stencil_front_z_fail_op); | |
| 583 } | |
| 584 return true; | |
| 585 case GL_STENCIL_PASS_DEPTH_PASS: | |
| 586 *num_written = 1; | |
| 587 if (params) { | |
| 588 params[0] = static_cast<GLfloat>(stencil_front_z_pass_op); | |
| 589 } | |
| 590 return true; | |
| 591 case GL_STENCIL_BACK_FAIL: | |
| 592 *num_written = 1; | |
| 593 if (params) { | |
| 594 params[0] = static_cast<GLfloat>(stencil_back_fail_op); | |
| 595 } | |
| 596 return true; | |
| 597 case GL_STENCIL_BACK_PASS_DEPTH_FAIL: | |
| 598 *num_written = 1; | |
| 599 if (params) { | |
| 600 params[0] = static_cast<GLfloat>(stencil_back_z_fail_op); | |
| 601 } | |
| 602 return true; | |
| 603 case GL_STENCIL_BACK_PASS_DEPTH_PASS: | |
| 604 *num_written = 1; | |
| 605 if (params) { | |
| 606 params[0] = static_cast<GLfloat>(stencil_back_z_pass_op); | |
| 607 } | |
| 608 return true; | |
| 609 case GL_SCISSOR_BOX: | |
| 610 *num_written = 4; | |
| 611 if (params) { | |
| 612 params[0] = static_cast<GLfloat>(scissor_x); | |
| 613 params[1] = static_cast<GLfloat>(scissor_y); | |
| 614 params[2] = static_cast<GLfloat>(scissor_width); | |
| 615 params[3] = static_cast<GLfloat>(scissor_height); | |
| 616 } | |
| 617 return true; | |
| 618 case GL_FRONT_FACE: | 592 case GL_FRONT_FACE: |
| 619 *num_written = 1; | 593 *num_written = 1; |
| 620 if (params) { | 594 if (params) { |
| 621 params[0] = static_cast<GLfloat>(front_face); | 595 params[0] = static_cast<GLfloat>(front_face); |
| 622 } | 596 } |
| 623 return true; | 597 return true; |
| 624 case GL_SAMPLE_COVERAGE_VALUE: | 598 case GL_GENERATE_MIPMAP_HINT: |
| 625 *num_written = 1; | 599 *num_written = 1; |
| 626 if (params) { | 600 if (params) { |
| 627 params[0] = static_cast<GLfloat>(sample_coverage_value); | 601 params[0] = static_cast<GLfloat>(hint_generate_mipmap); |
| 628 } | 602 } |
| 629 return true; | 603 return true; |
| 630 case GL_SAMPLE_COVERAGE_INVERT: | 604 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: |
| 631 *num_written = 1; | 605 *num_written = 1; |
| 632 if (params) { | 606 if (params) { |
| 633 params[0] = static_cast<GLfloat>(sample_coverage_invert); | 607 params[0] = static_cast<GLfloat>(hint_fragment_shader_derivative); |
| 608 } |
| 609 return true; |
| 610 case GL_LINE_WIDTH: |
| 611 *num_written = 1; |
| 612 if (params) { |
| 613 params[0] = static_cast<GLfloat>(line_width); |
| 614 } |
| 615 return true; |
| 616 case GL_PACK_ALIGNMENT: |
| 617 *num_written = 1; |
| 618 if (params) { |
| 619 params[0] = static_cast<GLfloat>(pack_alignment); |
| 620 } |
| 621 return true; |
| 622 case GL_UNPACK_ALIGNMENT: |
| 623 *num_written = 1; |
| 624 if (params) { |
| 625 params[0] = static_cast<GLfloat>(unpack_alignment); |
| 634 } | 626 } |
| 635 return true; | 627 return true; |
| 636 case GL_POLYGON_OFFSET_FACTOR: | 628 case GL_POLYGON_OFFSET_FACTOR: |
| 637 *num_written = 1; | 629 *num_written = 1; |
| 638 if (params) { | 630 if (params) { |
| 639 params[0] = static_cast<GLfloat>(polygon_offset_factor); | 631 params[0] = static_cast<GLfloat>(polygon_offset_factor); |
| 640 } | 632 } |
| 641 return true; | 633 return true; |
| 642 case GL_POLYGON_OFFSET_UNITS: | 634 case GL_POLYGON_OFFSET_UNITS: |
| 643 *num_written = 1; | 635 *num_written = 1; |
| 644 if (params) { | 636 if (params) { |
| 645 params[0] = static_cast<GLfloat>(polygon_offset_units); | 637 params[0] = static_cast<GLfloat>(polygon_offset_units); |
| 646 } | 638 } |
| 647 return true; | 639 return true; |
| 648 case GL_CULL_FACE_MODE: | 640 case GL_SAMPLE_COVERAGE_VALUE: |
| 649 *num_written = 1; | 641 *num_written = 1; |
| 650 if (params) { | 642 if (params) { |
| 651 params[0] = static_cast<GLfloat>(cull_mode); | 643 params[0] = static_cast<GLfloat>(sample_coverage_value); |
| 652 } | 644 } |
| 653 return true; | 645 return true; |
| 654 case GL_DEPTH_FUNC: | 646 case GL_SAMPLE_COVERAGE_INVERT: |
| 655 *num_written = 1; | 647 *num_written = 1; |
| 656 if (params) { | 648 if (params) { |
| 657 params[0] = static_cast<GLfloat>(depth_func); | 649 params[0] = static_cast<GLfloat>(sample_coverage_invert); |
| 650 } |
| 651 return true; |
| 652 case GL_SCISSOR_BOX: |
| 653 *num_written = 4; |
| 654 if (params) { |
| 655 params[0] = static_cast<GLfloat>(scissor_x); |
| 656 params[1] = static_cast<GLfloat>(scissor_y); |
| 657 params[2] = static_cast<GLfloat>(scissor_width); |
| 658 params[3] = static_cast<GLfloat>(scissor_height); |
| 658 } | 659 } |
| 659 return true; | 660 return true; |
| 660 case GL_STENCIL_FUNC: | 661 case GL_STENCIL_FUNC: |
| 661 *num_written = 1; | 662 *num_written = 1; |
| 662 if (params) { | 663 if (params) { |
| 663 params[0] = static_cast<GLfloat>(stencil_front_func); | 664 params[0] = static_cast<GLfloat>(stencil_front_func); |
| 664 } | 665 } |
| 665 return true; | 666 return true; |
| 666 case GL_STENCIL_REF: | 667 case GL_STENCIL_REF: |
| 667 *num_written = 1; | 668 *num_written = 1; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 686 if (params) { | 687 if (params) { |
| 687 params[0] = static_cast<GLfloat>(stencil_back_ref); | 688 params[0] = static_cast<GLfloat>(stencil_back_ref); |
| 688 } | 689 } |
| 689 return true; | 690 return true; |
| 690 case GL_STENCIL_BACK_VALUE_MASK: | 691 case GL_STENCIL_BACK_VALUE_MASK: |
| 691 *num_written = 1; | 692 *num_written = 1; |
| 692 if (params) { | 693 if (params) { |
| 693 params[0] = static_cast<GLfloat>(stencil_back_mask); | 694 params[0] = static_cast<GLfloat>(stencil_back_mask); |
| 694 } | 695 } |
| 695 return true; | 696 return true; |
| 696 case GL_DEPTH_WRITEMASK: | |
| 697 *num_written = 1; | |
| 698 if (params) { | |
| 699 params[0] = static_cast<GLfloat>(depth_mask); | |
| 700 } | |
| 701 return true; | |
| 702 case GL_BLEND_EQUATION_RGB: | |
| 703 *num_written = 1; | |
| 704 if (params) { | |
| 705 params[0] = static_cast<GLfloat>(blend_equation_rgb); | |
| 706 } | |
| 707 return true; | |
| 708 case GL_BLEND_EQUATION_ALPHA: | |
| 709 *num_written = 1; | |
| 710 if (params) { | |
| 711 params[0] = static_cast<GLfloat>(blend_equation_alpha); | |
| 712 } | |
| 713 return true; | |
| 714 case GL_STENCIL_WRITEMASK: | 697 case GL_STENCIL_WRITEMASK: |
| 715 *num_written = 1; | 698 *num_written = 1; |
| 716 if (params) { | 699 if (params) { |
| 717 params[0] = static_cast<GLfloat>(stencil_front_writemask); | 700 params[0] = static_cast<GLfloat>(stencil_front_writemask); |
| 718 } | 701 } |
| 719 return true; | 702 return true; |
| 720 case GL_STENCIL_BACK_WRITEMASK: | 703 case GL_STENCIL_BACK_WRITEMASK: |
| 721 *num_written = 1; | 704 *num_written = 1; |
| 722 if (params) { | 705 if (params) { |
| 723 params[0] = static_cast<GLfloat>(stencil_back_writemask); | 706 params[0] = static_cast<GLfloat>(stencil_back_writemask); |
| 724 } | 707 } |
| 725 return true; | 708 return true; |
| 709 case GL_STENCIL_FAIL: |
| 710 *num_written = 1; |
| 711 if (params) { |
| 712 params[0] = static_cast<GLfloat>(stencil_front_fail_op); |
| 713 } |
| 714 return true; |
| 715 case GL_STENCIL_PASS_DEPTH_FAIL: |
| 716 *num_written = 1; |
| 717 if (params) { |
| 718 params[0] = static_cast<GLfloat>(stencil_front_z_fail_op); |
| 719 } |
| 720 return true; |
| 721 case GL_STENCIL_PASS_DEPTH_PASS: |
| 722 *num_written = 1; |
| 723 if (params) { |
| 724 params[0] = static_cast<GLfloat>(stencil_front_z_pass_op); |
| 725 } |
| 726 return true; |
| 727 case GL_STENCIL_BACK_FAIL: |
| 728 *num_written = 1; |
| 729 if (params) { |
| 730 params[0] = static_cast<GLfloat>(stencil_back_fail_op); |
| 731 } |
| 732 return true; |
| 733 case GL_STENCIL_BACK_PASS_DEPTH_FAIL: |
| 734 *num_written = 1; |
| 735 if (params) { |
| 736 params[0] = static_cast<GLfloat>(stencil_back_z_fail_op); |
| 737 } |
| 738 return true; |
| 739 case GL_STENCIL_BACK_PASS_DEPTH_PASS: |
| 740 *num_written = 1; |
| 741 if (params) { |
| 742 params[0] = static_cast<GLfloat>(stencil_back_z_pass_op); |
| 743 } |
| 744 return true; |
| 745 case GL_VIEWPORT: |
| 746 *num_written = 4; |
| 747 if (params) { |
| 748 params[0] = static_cast<GLfloat>(viewport_x); |
| 749 params[1] = static_cast<GLfloat>(viewport_y); |
| 750 params[2] = static_cast<GLfloat>(viewport_width); |
| 751 params[3] = static_cast<GLfloat>(viewport_height); |
| 752 } |
| 753 return true; |
| 726 case GL_BLEND: | 754 case GL_BLEND: |
| 727 *num_written = 1; | 755 *num_written = 1; |
| 728 if (params) { | 756 if (params) { |
| 729 params[0] = static_cast<GLfloat>(enable_flags.blend); | 757 params[0] = static_cast<GLfloat>(enable_flags.blend); |
| 730 } | 758 } |
| 731 return true; | 759 return true; |
| 732 case GL_CULL_FACE: | 760 case GL_CULL_FACE: |
| 733 *num_written = 1; | 761 *num_written = 1; |
| 734 if (params) { | 762 if (params) { |
| 735 params[0] = static_cast<GLfloat>(enable_flags.cull_face); | 763 params[0] = static_cast<GLfloat>(enable_flags.cull_face); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 if (params) { | 805 if (params) { |
| 778 params[0] = static_cast<GLfloat>(enable_flags.stencil_test); | 806 params[0] = static_cast<GLfloat>(enable_flags.stencil_test); |
| 779 } | 807 } |
| 780 return true; | 808 return true; |
| 781 default: | 809 default: |
| 782 return false; | 810 return false; |
| 783 } | 811 } |
| 784 } | 812 } |
| 785 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ | 813 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ |
| 786 | 814 |
| OLD | NEW |