| 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_GENERATE_MIPMAP_HINT: |
| 165 *num_written = 4; | 169 *num_written = 1; |
| 166 if (params) { | 170 if (params) { |
| 167 params[0] = static_cast<GLint>(viewport_x); | 171 params[0] = static_cast<GLint>(hint_generate_mipmap); |
| 168 params[1] = static_cast<GLint>(viewport_y); | |
| 169 params[2] = static_cast<GLint>(viewport_width); | |
| 170 params[3] = static_cast<GLint>(viewport_height); | |
| 171 } | 172 } |
| 172 return true; | 173 return true; |
| 173 case GL_BLEND_SRC_RGB: | 174 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: |
| 174 *num_written = 1; | 175 *num_written = 1; |
| 175 if (params) { | 176 if (params) { |
| 176 params[0] = static_cast<GLint>(blend_source_rgb); | 177 params[0] = static_cast<GLint>(hint_fragment_shader_derivative); |
| 177 } | 178 } |
| 178 return true; | 179 return true; |
| 179 case GL_BLEND_DST_RGB: | 180 case GL_DEPTH_CLEAR_VALUE: |
| 180 *num_written = 1; | 181 *num_written = 1; |
| 181 if (params) { | 182 if (params) { |
| 182 params[0] = static_cast<GLint>(blend_dest_rgb); | 183 params[0] = static_cast<GLint>(depth_clear); |
| 183 } | 184 } |
| 184 return true; | 185 return true; |
| 185 case GL_BLEND_SRC_ALPHA: | 186 case GL_CULL_FACE_MODE: |
| 186 *num_written = 1; | 187 *num_written = 1; |
| 187 if (params) { | 188 if (params) { |
| 188 params[0] = static_cast<GLint>(blend_source_alpha); | 189 params[0] = static_cast<GLint>(cull_mode); |
| 189 } | |
| 190 return true; | |
| 191 case GL_BLEND_DST_ALPHA: | |
| 192 *num_written = 1; | |
| 193 if (params) { | |
| 194 params[0] = static_cast<GLint>(blend_dest_alpha); | |
| 195 } | 190 } |
| 196 return true; | 191 return true; |
| 197 case GL_LINE_WIDTH: | 192 case GL_LINE_WIDTH: |
| 198 *num_written = 1; | 193 *num_written = 1; |
| 199 if (params) { | 194 if (params) { |
| 200 params[0] = static_cast<GLint>(line_width); | 195 params[0] = static_cast<GLint>(line_width); |
| 201 } | 196 } |
| 202 return true; | 197 return true; |
| 203 case GL_BLEND_COLOR: | 198 case GL_BLEND_COLOR: |
| 204 *num_written = 4; | 199 *num_written = 4; |
| 205 if (params) { | 200 if (params) { |
| 206 params[0] = static_cast<GLint>(blend_color_red); | 201 params[0] = static_cast<GLint>(blend_color_red); |
| 207 params[1] = static_cast<GLint>(blend_color_green); | 202 params[1] = static_cast<GLint>(blend_color_green); |
| 208 params[2] = static_cast<GLint>(blend_color_blue); | 203 params[2] = static_cast<GLint>(blend_color_blue); |
| 209 params[3] = static_cast<GLint>(blend_color_alpha); | 204 params[3] = static_cast<GLint>(blend_color_alpha); |
| 210 } | 205 } |
| 211 return true; | 206 return true; |
| 212 case GL_STENCIL_CLEAR_VALUE: | 207 case GL_STENCIL_CLEAR_VALUE: |
| 213 *num_written = 1; | 208 *num_written = 1; |
| 214 if (params) { | 209 if (params) { |
| 215 params[0] = static_cast<GLint>(stencil_clear); | 210 params[0] = static_cast<GLint>(stencil_clear); |
| 216 } | 211 } |
| 217 return true; | 212 return true; |
| 218 case GL_GENERATE_MIPMAP_HINT: | 213 case GL_PACK_ALIGNMENT: |
| 219 *num_written = 1; | 214 *num_written = 1; |
| 220 if (params) { | 215 if (params) { |
| 221 params[0] = static_cast<GLint>(hint_generate_mipmap); | 216 params[0] = static_cast<GLint>(pack_alignment); |
| 222 } | 217 } |
| 223 return true; | 218 return true; |
| 224 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: | 219 case GL_UNPACK_ALIGNMENT: |
| 225 *num_written = 1; | 220 *num_written = 1; |
| 226 if (params) { | 221 if (params) { |
| 227 params[0] = static_cast<GLint>(hint_fragment_shader_derivative); | 222 params[0] = static_cast<GLint>(unpack_alignment); |
| 223 } |
| 224 return true; |
| 225 case GL_STENCIL_WRITEMASK: |
| 226 *num_written = 1; |
| 227 if (params) { |
| 228 params[0] = static_cast<GLint>(stencil_front_writemask); |
| 229 } |
| 230 return true; |
| 231 case GL_STENCIL_BACK_WRITEMASK: |
| 232 *num_written = 1; |
| 233 if (params) { |
| 234 params[0] = static_cast<GLint>(stencil_back_writemask); |
| 235 } |
| 236 return true; |
| 237 case GL_VIEWPORT: |
| 238 *num_written = 4; |
| 239 if (params) { |
| 240 params[0] = static_cast<GLint>(viewport_x); |
| 241 params[1] = static_cast<GLint>(viewport_y); |
| 242 params[2] = static_cast<GLint>(viewport_width); |
| 243 params[3] = static_cast<GLint>(viewport_height); |
| 228 } | 244 } |
| 229 return true; | 245 return true; |
| 230 case GL_COLOR_WRITEMASK: | 246 case GL_COLOR_WRITEMASK: |
| 231 *num_written = 4; | 247 *num_written = 4; |
| 232 if (params) { | 248 if (params) { |
| 233 params[0] = static_cast<GLint>(color_mask_red); | 249 params[0] = static_cast<GLint>(color_mask_red); |
| 234 params[1] = static_cast<GLint>(color_mask_green); | 250 params[1] = static_cast<GLint>(color_mask_green); |
| 235 params[2] = static_cast<GLint>(color_mask_blue); | 251 params[2] = static_cast<GLint>(color_mask_blue); |
| 236 params[3] = static_cast<GLint>(color_mask_alpha); | 252 params[3] = static_cast<GLint>(color_mask_alpha); |
| 237 } | 253 } |
| 238 return true; | 254 return true; |
| 239 case GL_COLOR_CLEAR_VALUE: | 255 case GL_COLOR_CLEAR_VALUE: |
| 240 *num_written = 4; | 256 *num_written = 4; |
| 241 if (params) { | 257 if (params) { |
| 242 params[0] = static_cast<GLint>(color_clear_red); | 258 params[0] = static_cast<GLint>(color_clear_red); |
| 243 params[1] = static_cast<GLint>(color_clear_green); | 259 params[1] = static_cast<GLint>(color_clear_green); |
| 244 params[2] = static_cast<GLint>(color_clear_blue); | 260 params[2] = static_cast<GLint>(color_clear_blue); |
| 245 params[3] = static_cast<GLint>(color_clear_alpha); | 261 params[3] = static_cast<GLint>(color_clear_alpha); |
| 246 } | 262 } |
| 247 return true; | 263 return true; |
| 248 case GL_DEPTH_RANGE: | 264 case GL_DEPTH_RANGE: |
| 249 *num_written = 2; | 265 *num_written = 2; |
| 250 if (params) { | 266 if (params) { |
| 251 params[0] = static_cast<GLint>(z_near); | 267 params[0] = static_cast<GLint>(z_near); |
| 252 params[1] = static_cast<GLint>(z_far); | 268 params[1] = static_cast<GLint>(z_far); |
| 253 } | 269 } |
| 254 return true; | 270 return true; |
| 255 case GL_DEPTH_CLEAR_VALUE: | 271 case GL_SCISSOR_BOX: |
| 272 *num_written = 4; |
| 273 if (params) { |
| 274 params[0] = static_cast<GLint>(scissor_x); |
| 275 params[1] = static_cast<GLint>(scissor_y); |
| 276 params[2] = static_cast<GLint>(scissor_width); |
| 277 params[3] = static_cast<GLint>(scissor_height); |
| 278 } |
| 279 return true; |
| 280 case GL_POLYGON_OFFSET_FACTOR: |
| 256 *num_written = 1; | 281 *num_written = 1; |
| 257 if (params) { | 282 if (params) { |
| 258 params[0] = static_cast<GLint>(depth_clear); | 283 params[0] = static_cast<GLint>(polygon_offset_factor); |
| 284 } |
| 285 return true; |
| 286 case GL_POLYGON_OFFSET_UNITS: |
| 287 *num_written = 1; |
| 288 if (params) { |
| 289 params[0] = static_cast<GLint>(polygon_offset_units); |
| 290 } |
| 291 return true; |
| 292 case GL_SAMPLE_COVERAGE_VALUE: |
| 293 *num_written = 1; |
| 294 if (params) { |
| 295 params[0] = static_cast<GLint>(sample_coverage_value); |
| 296 } |
| 297 return true; |
| 298 case GL_SAMPLE_COVERAGE_INVERT: |
| 299 *num_written = 1; |
| 300 if (params) { |
| 301 params[0] = static_cast<GLint>(sample_coverage_invert); |
| 302 } |
| 303 return true; |
| 304 case GL_STENCIL_FUNC: |
| 305 *num_written = 1; |
| 306 if (params) { |
| 307 params[0] = static_cast<GLint>(stencil_front_func); |
| 308 } |
| 309 return true; |
| 310 case GL_STENCIL_REF: |
| 311 *num_written = 1; |
| 312 if (params) { |
| 313 params[0] = static_cast<GLint>(stencil_front_ref); |
| 314 } |
| 315 return true; |
| 316 case GL_STENCIL_VALUE_MASK: |
| 317 *num_written = 1; |
| 318 if (params) { |
| 319 params[0] = static_cast<GLint>(stencil_front_mask); |
| 320 } |
| 321 return true; |
| 322 case GL_STENCIL_BACK_FUNC: |
| 323 *num_written = 1; |
| 324 if (params) { |
| 325 params[0] = static_cast<GLint>(stencil_back_func); |
| 326 } |
| 327 return true; |
| 328 case GL_STENCIL_BACK_REF: |
| 329 *num_written = 1; |
| 330 if (params) { |
| 331 params[0] = static_cast<GLint>(stencil_back_ref); |
| 332 } |
| 333 return true; |
| 334 case GL_STENCIL_BACK_VALUE_MASK: |
| 335 *num_written = 1; |
| 336 if (params) { |
| 337 params[0] = static_cast<GLint>(stencil_back_mask); |
| 338 } |
| 339 return true; |
| 340 case GL_BLEND_SRC_RGB: |
| 341 *num_written = 1; |
| 342 if (params) { |
| 343 params[0] = static_cast<GLint>(blend_source_rgb); |
| 344 } |
| 345 return true; |
| 346 case GL_BLEND_DST_RGB: |
| 347 *num_written = 1; |
| 348 if (params) { |
| 349 params[0] = static_cast<GLint>(blend_dest_rgb); |
| 350 } |
| 351 return true; |
| 352 case GL_BLEND_SRC_ALPHA: |
| 353 *num_written = 1; |
| 354 if (params) { |
| 355 params[0] = static_cast<GLint>(blend_source_alpha); |
| 356 } |
| 357 return true; |
| 358 case GL_BLEND_DST_ALPHA: |
| 359 *num_written = 1; |
| 360 if (params) { |
| 361 params[0] = static_cast<GLint>(blend_dest_alpha); |
| 362 } |
| 363 return true; |
| 364 case GL_DEPTH_FUNC: |
| 365 *num_written = 1; |
| 366 if (params) { |
| 367 params[0] = static_cast<GLint>(depth_func); |
| 368 } |
| 369 return true; |
| 370 case GL_DEPTH_WRITEMASK: |
| 371 *num_written = 1; |
| 372 if (params) { |
| 373 params[0] = static_cast<GLint>(depth_mask); |
| 259 } | 374 } |
| 260 return true; | 375 return true; |
| 261 case GL_STENCIL_FAIL: | 376 case GL_STENCIL_FAIL: |
| 262 *num_written = 1; | 377 *num_written = 1; |
| 263 if (params) { | 378 if (params) { |
| 264 params[0] = static_cast<GLint>(stencil_front_fail_op); | 379 params[0] = static_cast<GLint>(stencil_front_fail_op); |
| 265 } | 380 } |
| 266 return true; | 381 return true; |
| 267 case GL_STENCIL_PASS_DEPTH_FAIL: | 382 case GL_STENCIL_PASS_DEPTH_FAIL: |
| 268 *num_written = 1; | 383 *num_written = 1; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 287 if (params) { | 402 if (params) { |
| 288 params[0] = static_cast<GLint>(stencil_back_z_fail_op); | 403 params[0] = static_cast<GLint>(stencil_back_z_fail_op); |
| 289 } | 404 } |
| 290 return true; | 405 return true; |
| 291 case GL_STENCIL_BACK_PASS_DEPTH_PASS: | 406 case GL_STENCIL_BACK_PASS_DEPTH_PASS: |
| 292 *num_written = 1; | 407 *num_written = 1; |
| 293 if (params) { | 408 if (params) { |
| 294 params[0] = static_cast<GLint>(stencil_back_z_pass_op); | 409 params[0] = static_cast<GLint>(stencil_back_z_pass_op); |
| 295 } | 410 } |
| 296 return true; | 411 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: | 412 case GL_FRONT_FACE: |
| 307 *num_written = 1; | 413 *num_written = 1; |
| 308 if (params) { | 414 if (params) { |
| 309 params[0] = static_cast<GLint>(front_face); | 415 params[0] = static_cast<GLint>(front_face); |
| 310 } | 416 } |
| 311 return true; | 417 return true; |
| 312 case GL_SAMPLE_COVERAGE_VALUE: | |
| 313 *num_written = 1; | |
| 314 if (params) { | |
| 315 params[0] = static_cast<GLint>(sample_coverage_value); | |
| 316 } | |
| 317 return true; | |
| 318 case GL_SAMPLE_COVERAGE_INVERT: | |
| 319 *num_written = 1; | |
| 320 if (params) { | |
| 321 params[0] = static_cast<GLint>(sample_coverage_invert); | |
| 322 } | |
| 323 return true; | |
| 324 case GL_POLYGON_OFFSET_FACTOR: | |
| 325 *num_written = 1; | |
| 326 if (params) { | |
| 327 params[0] = static_cast<GLint>(polygon_offset_factor); | |
| 328 } | |
| 329 return true; | |
| 330 case GL_POLYGON_OFFSET_UNITS: | |
| 331 *num_written = 1; | |
| 332 if (params) { | |
| 333 params[0] = static_cast<GLint>(polygon_offset_units); | |
| 334 } | |
| 335 return true; | |
| 336 case GL_CULL_FACE_MODE: | |
| 337 *num_written = 1; | |
| 338 if (params) { | |
| 339 params[0] = static_cast<GLint>(cull_mode); | |
| 340 } | |
| 341 return true; | |
| 342 case GL_DEPTH_FUNC: | |
| 343 *num_written = 1; | |
| 344 if (params) { | |
| 345 params[0] = static_cast<GLint>(depth_func); | |
| 346 } | |
| 347 return true; | |
| 348 case GL_STENCIL_FUNC: | |
| 349 *num_written = 1; | |
| 350 if (params) { | |
| 351 params[0] = static_cast<GLint>(stencil_front_func); | |
| 352 } | |
| 353 return true; | |
| 354 case GL_STENCIL_REF: | |
| 355 *num_written = 1; | |
| 356 if (params) { | |
| 357 params[0] = static_cast<GLint>(stencil_front_ref); | |
| 358 } | |
| 359 return true; | |
| 360 case GL_STENCIL_VALUE_MASK: | |
| 361 *num_written = 1; | |
| 362 if (params) { | |
| 363 params[0] = static_cast<GLint>(stencil_front_mask); | |
| 364 } | |
| 365 return true; | |
| 366 case GL_STENCIL_BACK_FUNC: | |
| 367 *num_written = 1; | |
| 368 if (params) { | |
| 369 params[0] = static_cast<GLint>(stencil_back_func); | |
| 370 } | |
| 371 return true; | |
| 372 case GL_STENCIL_BACK_REF: | |
| 373 *num_written = 1; | |
| 374 if (params) { | |
| 375 params[0] = static_cast<GLint>(stencil_back_ref); | |
| 376 } | |
| 377 return true; | |
| 378 case GL_STENCIL_BACK_VALUE_MASK: | |
| 379 *num_written = 1; | |
| 380 if (params) { | |
| 381 params[0] = static_cast<GLint>(stencil_back_mask); | |
| 382 } | |
| 383 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: | 418 case GL_BLEND_EQUATION_RGB: |
| 391 *num_written = 1; | 419 *num_written = 1; |
| 392 if (params) { | 420 if (params) { |
| 393 params[0] = static_cast<GLint>(blend_equation_rgb); | 421 params[0] = static_cast<GLint>(blend_equation_rgb); |
| 394 } | 422 } |
| 395 return true; | 423 return true; |
| 396 case GL_BLEND_EQUATION_ALPHA: | 424 case GL_BLEND_EQUATION_ALPHA: |
| 397 *num_written = 1; | 425 *num_written = 1; |
| 398 if (params) { | 426 if (params) { |
| 399 params[0] = static_cast<GLint>(blend_equation_alpha); | 427 params[0] = static_cast<GLint>(blend_equation_alpha); |
| 400 } | 428 } |
| 401 return true; | 429 return true; |
| 402 case GL_STENCIL_WRITEMASK: | |
| 403 *num_written = 1; | |
| 404 if (params) { | |
| 405 params[0] = static_cast<GLint>(stencil_front_writemask); | |
| 406 } | |
| 407 return true; | |
| 408 case GL_STENCIL_BACK_WRITEMASK: | |
| 409 *num_written = 1; | |
| 410 if (params) { | |
| 411 params[0] = static_cast<GLint>(stencil_back_writemask); | |
| 412 } | |
| 413 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_GENERATE_MIPMAP_HINT: |
| 477 *num_written = 4; | 493 *num_written = 1; |
| 478 if (params) { | 494 if (params) { |
| 479 params[0] = static_cast<GLfloat>(viewport_x); | 495 params[0] = static_cast<GLfloat>(hint_generate_mipmap); |
| 480 params[1] = static_cast<GLfloat>(viewport_y); | |
| 481 params[2] = static_cast<GLfloat>(viewport_width); | |
| 482 params[3] = static_cast<GLfloat>(viewport_height); | |
| 483 } | 496 } |
| 484 return true; | 497 return true; |
| 485 case GL_BLEND_SRC_RGB: | 498 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: |
| 486 *num_written = 1; | 499 *num_written = 1; |
| 487 if (params) { | 500 if (params) { |
| 488 params[0] = static_cast<GLfloat>(blend_source_rgb); | 501 params[0] = static_cast<GLfloat>(hint_fragment_shader_derivative); |
| 489 } | 502 } |
| 490 return true; | 503 return true; |
| 491 case GL_BLEND_DST_RGB: | 504 case GL_DEPTH_CLEAR_VALUE: |
| 492 *num_written = 1; | 505 *num_written = 1; |
| 493 if (params) { | 506 if (params) { |
| 494 params[0] = static_cast<GLfloat>(blend_dest_rgb); | 507 params[0] = static_cast<GLfloat>(depth_clear); |
| 495 } | 508 } |
| 496 return true; | 509 return true; |
| 497 case GL_BLEND_SRC_ALPHA: | 510 case GL_CULL_FACE_MODE: |
| 498 *num_written = 1; | 511 *num_written = 1; |
| 499 if (params) { | 512 if (params) { |
| 500 params[0] = static_cast<GLfloat>(blend_source_alpha); | 513 params[0] = static_cast<GLfloat>(cull_mode); |
| 501 } | |
| 502 return true; | |
| 503 case GL_BLEND_DST_ALPHA: | |
| 504 *num_written = 1; | |
| 505 if (params) { | |
| 506 params[0] = static_cast<GLfloat>(blend_dest_alpha); | |
| 507 } | 514 } |
| 508 return true; | 515 return true; |
| 509 case GL_LINE_WIDTH: | 516 case GL_LINE_WIDTH: |
| 510 *num_written = 1; | 517 *num_written = 1; |
| 511 if (params) { | 518 if (params) { |
| 512 params[0] = static_cast<GLfloat>(line_width); | 519 params[0] = static_cast<GLfloat>(line_width); |
| 513 } | 520 } |
| 514 return true; | 521 return true; |
| 515 case GL_BLEND_COLOR: | 522 case GL_BLEND_COLOR: |
| 516 *num_written = 4; | 523 *num_written = 4; |
| 517 if (params) { | 524 if (params) { |
| 518 params[0] = static_cast<GLfloat>(blend_color_red); | 525 params[0] = static_cast<GLfloat>(blend_color_red); |
| 519 params[1] = static_cast<GLfloat>(blend_color_green); | 526 params[1] = static_cast<GLfloat>(blend_color_green); |
| 520 params[2] = static_cast<GLfloat>(blend_color_blue); | 527 params[2] = static_cast<GLfloat>(blend_color_blue); |
| 521 params[3] = static_cast<GLfloat>(blend_color_alpha); | 528 params[3] = static_cast<GLfloat>(blend_color_alpha); |
| 522 } | 529 } |
| 523 return true; | 530 return true; |
| 524 case GL_STENCIL_CLEAR_VALUE: | 531 case GL_STENCIL_CLEAR_VALUE: |
| 525 *num_written = 1; | 532 *num_written = 1; |
| 526 if (params) { | 533 if (params) { |
| 527 params[0] = static_cast<GLfloat>(stencil_clear); | 534 params[0] = static_cast<GLfloat>(stencil_clear); |
| 528 } | 535 } |
| 529 return true; | 536 return true; |
| 530 case GL_GENERATE_MIPMAP_HINT: | 537 case GL_PACK_ALIGNMENT: |
| 531 *num_written = 1; | 538 *num_written = 1; |
| 532 if (params) { | 539 if (params) { |
| 533 params[0] = static_cast<GLfloat>(hint_generate_mipmap); | 540 params[0] = static_cast<GLfloat>(pack_alignment); |
| 534 } | 541 } |
| 535 return true; | 542 return true; |
| 536 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: | 543 case GL_UNPACK_ALIGNMENT: |
| 537 *num_written = 1; | 544 *num_written = 1; |
| 538 if (params) { | 545 if (params) { |
| 539 params[0] = static_cast<GLfloat>(hint_fragment_shader_derivative); | 546 params[0] = static_cast<GLfloat>(unpack_alignment); |
| 547 } |
| 548 return true; |
| 549 case GL_STENCIL_WRITEMASK: |
| 550 *num_written = 1; |
| 551 if (params) { |
| 552 params[0] = static_cast<GLfloat>(stencil_front_writemask); |
| 553 } |
| 554 return true; |
| 555 case GL_STENCIL_BACK_WRITEMASK: |
| 556 *num_written = 1; |
| 557 if (params) { |
| 558 params[0] = static_cast<GLfloat>(stencil_back_writemask); |
| 559 } |
| 560 return true; |
| 561 case GL_VIEWPORT: |
| 562 *num_written = 4; |
| 563 if (params) { |
| 564 params[0] = static_cast<GLfloat>(viewport_x); |
| 565 params[1] = static_cast<GLfloat>(viewport_y); |
| 566 params[2] = static_cast<GLfloat>(viewport_width); |
| 567 params[3] = static_cast<GLfloat>(viewport_height); |
| 540 } | 568 } |
| 541 return true; | 569 return true; |
| 542 case GL_COLOR_WRITEMASK: | 570 case GL_COLOR_WRITEMASK: |
| 543 *num_written = 4; | 571 *num_written = 4; |
| 544 if (params) { | 572 if (params) { |
| 545 params[0] = static_cast<GLfloat>(color_mask_red); | 573 params[0] = static_cast<GLfloat>(color_mask_red); |
| 546 params[1] = static_cast<GLfloat>(color_mask_green); | 574 params[1] = static_cast<GLfloat>(color_mask_green); |
| 547 params[2] = static_cast<GLfloat>(color_mask_blue); | 575 params[2] = static_cast<GLfloat>(color_mask_blue); |
| 548 params[3] = static_cast<GLfloat>(color_mask_alpha); | 576 params[3] = static_cast<GLfloat>(color_mask_alpha); |
| 549 } | 577 } |
| 550 return true; | 578 return true; |
| 551 case GL_COLOR_CLEAR_VALUE: | 579 case GL_COLOR_CLEAR_VALUE: |
| 552 *num_written = 4; | 580 *num_written = 4; |
| 553 if (params) { | 581 if (params) { |
| 554 params[0] = static_cast<GLfloat>(color_clear_red); | 582 params[0] = static_cast<GLfloat>(color_clear_red); |
| 555 params[1] = static_cast<GLfloat>(color_clear_green); | 583 params[1] = static_cast<GLfloat>(color_clear_green); |
| 556 params[2] = static_cast<GLfloat>(color_clear_blue); | 584 params[2] = static_cast<GLfloat>(color_clear_blue); |
| 557 params[3] = static_cast<GLfloat>(color_clear_alpha); | 585 params[3] = static_cast<GLfloat>(color_clear_alpha); |
| 558 } | 586 } |
| 559 return true; | 587 return true; |
| 560 case GL_DEPTH_RANGE: | 588 case GL_DEPTH_RANGE: |
| 561 *num_written = 2; | 589 *num_written = 2; |
| 562 if (params) { | 590 if (params) { |
| 563 params[0] = static_cast<GLfloat>(z_near); | 591 params[0] = static_cast<GLfloat>(z_near); |
| 564 params[1] = static_cast<GLfloat>(z_far); | 592 params[1] = static_cast<GLfloat>(z_far); |
| 565 } | 593 } |
| 566 return true; | 594 return true; |
| 567 case GL_DEPTH_CLEAR_VALUE: | 595 case GL_SCISSOR_BOX: |
| 596 *num_written = 4; |
| 597 if (params) { |
| 598 params[0] = static_cast<GLfloat>(scissor_x); |
| 599 params[1] = static_cast<GLfloat>(scissor_y); |
| 600 params[2] = static_cast<GLfloat>(scissor_width); |
| 601 params[3] = static_cast<GLfloat>(scissor_height); |
| 602 } |
| 603 return true; |
| 604 case GL_POLYGON_OFFSET_FACTOR: |
| 568 *num_written = 1; | 605 *num_written = 1; |
| 569 if (params) { | 606 if (params) { |
| 570 params[0] = static_cast<GLfloat>(depth_clear); | 607 params[0] = static_cast<GLfloat>(polygon_offset_factor); |
| 608 } |
| 609 return true; |
| 610 case GL_POLYGON_OFFSET_UNITS: |
| 611 *num_written = 1; |
| 612 if (params) { |
| 613 params[0] = static_cast<GLfloat>(polygon_offset_units); |
| 614 } |
| 615 return true; |
| 616 case GL_SAMPLE_COVERAGE_VALUE: |
| 617 *num_written = 1; |
| 618 if (params) { |
| 619 params[0] = static_cast<GLfloat>(sample_coverage_value); |
| 620 } |
| 621 return true; |
| 622 case GL_SAMPLE_COVERAGE_INVERT: |
| 623 *num_written = 1; |
| 624 if (params) { |
| 625 params[0] = static_cast<GLfloat>(sample_coverage_invert); |
| 626 } |
| 627 return true; |
| 628 case GL_STENCIL_FUNC: |
| 629 *num_written = 1; |
| 630 if (params) { |
| 631 params[0] = static_cast<GLfloat>(stencil_front_func); |
| 632 } |
| 633 return true; |
| 634 case GL_STENCIL_REF: |
| 635 *num_written = 1; |
| 636 if (params) { |
| 637 params[0] = static_cast<GLfloat>(stencil_front_ref); |
| 638 } |
| 639 return true; |
| 640 case GL_STENCIL_VALUE_MASK: |
| 641 *num_written = 1; |
| 642 if (params) { |
| 643 params[0] = static_cast<GLfloat>(stencil_front_mask); |
| 644 } |
| 645 return true; |
| 646 case GL_STENCIL_BACK_FUNC: |
| 647 *num_written = 1; |
| 648 if (params) { |
| 649 params[0] = static_cast<GLfloat>(stencil_back_func); |
| 650 } |
| 651 return true; |
| 652 case GL_STENCIL_BACK_REF: |
| 653 *num_written = 1; |
| 654 if (params) { |
| 655 params[0] = static_cast<GLfloat>(stencil_back_ref); |
| 656 } |
| 657 return true; |
| 658 case GL_STENCIL_BACK_VALUE_MASK: |
| 659 *num_written = 1; |
| 660 if (params) { |
| 661 params[0] = static_cast<GLfloat>(stencil_back_mask); |
| 662 } |
| 663 return true; |
| 664 case GL_BLEND_SRC_RGB: |
| 665 *num_written = 1; |
| 666 if (params) { |
| 667 params[0] = static_cast<GLfloat>(blend_source_rgb); |
| 668 } |
| 669 return true; |
| 670 case GL_BLEND_DST_RGB: |
| 671 *num_written = 1; |
| 672 if (params) { |
| 673 params[0] = static_cast<GLfloat>(blend_dest_rgb); |
| 674 } |
| 675 return true; |
| 676 case GL_BLEND_SRC_ALPHA: |
| 677 *num_written = 1; |
| 678 if (params) { |
| 679 params[0] = static_cast<GLfloat>(blend_source_alpha); |
| 680 } |
| 681 return true; |
| 682 case GL_BLEND_DST_ALPHA: |
| 683 *num_written = 1; |
| 684 if (params) { |
| 685 params[0] = static_cast<GLfloat>(blend_dest_alpha); |
| 686 } |
| 687 return true; |
| 688 case GL_DEPTH_FUNC: |
| 689 *num_written = 1; |
| 690 if (params) { |
| 691 params[0] = static_cast<GLfloat>(depth_func); |
| 692 } |
| 693 return true; |
| 694 case GL_DEPTH_WRITEMASK: |
| 695 *num_written = 1; |
| 696 if (params) { |
| 697 params[0] = static_cast<GLfloat>(depth_mask); |
| 571 } | 698 } |
| 572 return true; | 699 return true; |
| 573 case GL_STENCIL_FAIL: | 700 case GL_STENCIL_FAIL: |
| 574 *num_written = 1; | 701 *num_written = 1; |
| 575 if (params) { | 702 if (params) { |
| 576 params[0] = static_cast<GLfloat>(stencil_front_fail_op); | 703 params[0] = static_cast<GLfloat>(stencil_front_fail_op); |
| 577 } | 704 } |
| 578 return true; | 705 return true; |
| 579 case GL_STENCIL_PASS_DEPTH_FAIL: | 706 case GL_STENCIL_PASS_DEPTH_FAIL: |
| 580 *num_written = 1; | 707 *num_written = 1; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 599 if (params) { | 726 if (params) { |
| 600 params[0] = static_cast<GLfloat>(stencil_back_z_fail_op); | 727 params[0] = static_cast<GLfloat>(stencil_back_z_fail_op); |
| 601 } | 728 } |
| 602 return true; | 729 return true; |
| 603 case GL_STENCIL_BACK_PASS_DEPTH_PASS: | 730 case GL_STENCIL_BACK_PASS_DEPTH_PASS: |
| 604 *num_written = 1; | 731 *num_written = 1; |
| 605 if (params) { | 732 if (params) { |
| 606 params[0] = static_cast<GLfloat>(stencil_back_z_pass_op); | 733 params[0] = static_cast<GLfloat>(stencil_back_z_pass_op); |
| 607 } | 734 } |
| 608 return true; | 735 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: | 736 case GL_FRONT_FACE: |
| 619 *num_written = 1; | 737 *num_written = 1; |
| 620 if (params) { | 738 if (params) { |
| 621 params[0] = static_cast<GLfloat>(front_face); | 739 params[0] = static_cast<GLfloat>(front_face); |
| 622 } | 740 } |
| 623 return true; | 741 return true; |
| 624 case GL_SAMPLE_COVERAGE_VALUE: | |
| 625 *num_written = 1; | |
| 626 if (params) { | |
| 627 params[0] = static_cast<GLfloat>(sample_coverage_value); | |
| 628 } | |
| 629 return true; | |
| 630 case GL_SAMPLE_COVERAGE_INVERT: | |
| 631 *num_written = 1; | |
| 632 if (params) { | |
| 633 params[0] = static_cast<GLfloat>(sample_coverage_invert); | |
| 634 } | |
| 635 return true; | |
| 636 case GL_POLYGON_OFFSET_FACTOR: | |
| 637 *num_written = 1; | |
| 638 if (params) { | |
| 639 params[0] = static_cast<GLfloat>(polygon_offset_factor); | |
| 640 } | |
| 641 return true; | |
| 642 case GL_POLYGON_OFFSET_UNITS: | |
| 643 *num_written = 1; | |
| 644 if (params) { | |
| 645 params[0] = static_cast<GLfloat>(polygon_offset_units); | |
| 646 } | |
| 647 return true; | |
| 648 case GL_CULL_FACE_MODE: | |
| 649 *num_written = 1; | |
| 650 if (params) { | |
| 651 params[0] = static_cast<GLfloat>(cull_mode); | |
| 652 } | |
| 653 return true; | |
| 654 case GL_DEPTH_FUNC: | |
| 655 *num_written = 1; | |
| 656 if (params) { | |
| 657 params[0] = static_cast<GLfloat>(depth_func); | |
| 658 } | |
| 659 return true; | |
| 660 case GL_STENCIL_FUNC: | |
| 661 *num_written = 1; | |
| 662 if (params) { | |
| 663 params[0] = static_cast<GLfloat>(stencil_front_func); | |
| 664 } | |
| 665 return true; | |
| 666 case GL_STENCIL_REF: | |
| 667 *num_written = 1; | |
| 668 if (params) { | |
| 669 params[0] = static_cast<GLfloat>(stencil_front_ref); | |
| 670 } | |
| 671 return true; | |
| 672 case GL_STENCIL_VALUE_MASK: | |
| 673 *num_written = 1; | |
| 674 if (params) { | |
| 675 params[0] = static_cast<GLfloat>(stencil_front_mask); | |
| 676 } | |
| 677 return true; | |
| 678 case GL_STENCIL_BACK_FUNC: | |
| 679 *num_written = 1; | |
| 680 if (params) { | |
| 681 params[0] = static_cast<GLfloat>(stencil_back_func); | |
| 682 } | |
| 683 return true; | |
| 684 case GL_STENCIL_BACK_REF: | |
| 685 *num_written = 1; | |
| 686 if (params) { | |
| 687 params[0] = static_cast<GLfloat>(stencil_back_ref); | |
| 688 } | |
| 689 return true; | |
| 690 case GL_STENCIL_BACK_VALUE_MASK: | |
| 691 *num_written = 1; | |
| 692 if (params) { | |
| 693 params[0] = static_cast<GLfloat>(stencil_back_mask); | |
| 694 } | |
| 695 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: | 742 case GL_BLEND_EQUATION_RGB: |
| 703 *num_written = 1; | 743 *num_written = 1; |
| 704 if (params) { | 744 if (params) { |
| 705 params[0] = static_cast<GLfloat>(blend_equation_rgb); | 745 params[0] = static_cast<GLfloat>(blend_equation_rgb); |
| 706 } | 746 } |
| 707 return true; | 747 return true; |
| 708 case GL_BLEND_EQUATION_ALPHA: | 748 case GL_BLEND_EQUATION_ALPHA: |
| 709 *num_written = 1; | 749 *num_written = 1; |
| 710 if (params) { | 750 if (params) { |
| 711 params[0] = static_cast<GLfloat>(blend_equation_alpha); | 751 params[0] = static_cast<GLfloat>(blend_equation_alpha); |
| 712 } | 752 } |
| 713 return true; | 753 return true; |
| 714 case GL_STENCIL_WRITEMASK: | |
| 715 *num_written = 1; | |
| 716 if (params) { | |
| 717 params[0] = static_cast<GLfloat>(stencil_front_writemask); | |
| 718 } | |
| 719 return true; | |
| 720 case GL_STENCIL_BACK_WRITEMASK: | |
| 721 *num_written = 1; | |
| 722 if (params) { | |
| 723 params[0] = static_cast<GLfloat>(stencil_back_writemask); | |
| 724 } | |
| 725 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 |