| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // It's formatted by clang-format using chromium coding style: | 7 // It's formatted by clang-format using chromium coding style: |
| 8 // clang-format -i -style=chromium filename | 8 // clang-format -i -style=chromium filename |
| 9 // DO NOT EDIT! | 9 // DO NOT EDIT! |
| 10 | 10 |
| 11 // It is included by context_state.cc | 11 // It is included by context_state.cc |
| 12 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ | 12 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ |
| 13 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ | 13 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ |
| 14 | 14 |
| 15 ContextState::EnableFlags::EnableFlags() | 15 ContextState::EnableFlags::EnableFlags() |
| 16 : blend(false), | 16 : blend(false), |
| 17 cached_blend(false), | 17 cached_blend(false), |
| 18 cull_face(false), | 18 cull_face(false), |
| 19 cached_cull_face(false), | 19 cached_cull_face(false), |
| 20 depth_test(false), | 20 depth_test(false), |
| 21 cached_depth_test(false), | 21 cached_depth_test(false), |
| 22 dither(true), | 22 dither(true), |
| 23 cached_dither(true), | 23 cached_dither(true), |
| 24 framebuffer_srgb_ext(true), | |
| 25 cached_framebuffer_srgb_ext(true), | |
| 26 polygon_offset_fill(false), | 24 polygon_offset_fill(false), |
| 27 cached_polygon_offset_fill(false), | 25 cached_polygon_offset_fill(false), |
| 28 sample_alpha_to_coverage(false), | 26 sample_alpha_to_coverage(false), |
| 29 cached_sample_alpha_to_coverage(false), | 27 cached_sample_alpha_to_coverage(false), |
| 30 sample_coverage(false), | 28 sample_coverage(false), |
| 31 cached_sample_coverage(false), | 29 cached_sample_coverage(false), |
| 32 scissor_test(false), | 30 scissor_test(false), |
| 33 cached_scissor_test(false), | 31 cached_scissor_test(false), |
| 34 stencil_test(false), | 32 stencil_test(false), |
| 35 cached_stencil_test(false), | 33 cached_stencil_test(false), |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 enable_flags.cached_cull_face) { | 160 enable_flags.cached_cull_face) { |
| 163 EnableDisable(GL_CULL_FACE, enable_flags.cached_cull_face); | 161 EnableDisable(GL_CULL_FACE, enable_flags.cached_cull_face); |
| 164 } | 162 } |
| 165 if (prev_state->enable_flags.cached_depth_test != | 163 if (prev_state->enable_flags.cached_depth_test != |
| 166 enable_flags.cached_depth_test) { | 164 enable_flags.cached_depth_test) { |
| 167 EnableDisable(GL_DEPTH_TEST, enable_flags.cached_depth_test); | 165 EnableDisable(GL_DEPTH_TEST, enable_flags.cached_depth_test); |
| 168 } | 166 } |
| 169 if (prev_state->enable_flags.cached_dither != enable_flags.cached_dither) { | 167 if (prev_state->enable_flags.cached_dither != enable_flags.cached_dither) { |
| 170 EnableDisable(GL_DITHER, enable_flags.cached_dither); | 168 EnableDisable(GL_DITHER, enable_flags.cached_dither); |
| 171 } | 169 } |
| 172 if (feature_info_->feature_flags().ext_srgb_write_control) { | |
| 173 if (prev_state->enable_flags.cached_framebuffer_srgb_ext != | |
| 174 enable_flags.cached_framebuffer_srgb_ext) { | |
| 175 EnableDisable(GL_FRAMEBUFFER_SRGB_EXT, | |
| 176 enable_flags.cached_framebuffer_srgb_ext); | |
| 177 } | |
| 178 } | |
| 179 if (prev_state->enable_flags.cached_polygon_offset_fill != | 170 if (prev_state->enable_flags.cached_polygon_offset_fill != |
| 180 enable_flags.cached_polygon_offset_fill) { | 171 enable_flags.cached_polygon_offset_fill) { |
| 181 EnableDisable(GL_POLYGON_OFFSET_FILL, | 172 EnableDisable(GL_POLYGON_OFFSET_FILL, |
| 182 enable_flags.cached_polygon_offset_fill); | 173 enable_flags.cached_polygon_offset_fill); |
| 183 } | 174 } |
| 184 if (prev_state->enable_flags.cached_sample_alpha_to_coverage != | 175 if (prev_state->enable_flags.cached_sample_alpha_to_coverage != |
| 185 enable_flags.cached_sample_alpha_to_coverage) { | 176 enable_flags.cached_sample_alpha_to_coverage) { |
| 186 EnableDisable(GL_SAMPLE_ALPHA_TO_COVERAGE, | 177 EnableDisable(GL_SAMPLE_ALPHA_TO_COVERAGE, |
| 187 enable_flags.cached_sample_alpha_to_coverage); | 178 enable_flags.cached_sample_alpha_to_coverage); |
| 188 } | 179 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 enable_flags.cached_primitive_restart_fixed_index) { | 212 enable_flags.cached_primitive_restart_fixed_index) { |
| 222 EnableDisable(GL_PRIMITIVE_RESTART_FIXED_INDEX, | 213 EnableDisable(GL_PRIMITIVE_RESTART_FIXED_INDEX, |
| 223 enable_flags.cached_primitive_restart_fixed_index); | 214 enable_flags.cached_primitive_restart_fixed_index); |
| 224 } | 215 } |
| 225 } | 216 } |
| 226 } else { | 217 } else { |
| 227 EnableDisable(GL_BLEND, enable_flags.cached_blend); | 218 EnableDisable(GL_BLEND, enable_flags.cached_blend); |
| 228 EnableDisable(GL_CULL_FACE, enable_flags.cached_cull_face); | 219 EnableDisable(GL_CULL_FACE, enable_flags.cached_cull_face); |
| 229 EnableDisable(GL_DEPTH_TEST, enable_flags.cached_depth_test); | 220 EnableDisable(GL_DEPTH_TEST, enable_flags.cached_depth_test); |
| 230 EnableDisable(GL_DITHER, enable_flags.cached_dither); | 221 EnableDisable(GL_DITHER, enable_flags.cached_dither); |
| 231 if (feature_info_->feature_flags().ext_srgb_write_control) { | |
| 232 EnableDisable(GL_FRAMEBUFFER_SRGB_EXT, | |
| 233 enable_flags.cached_framebuffer_srgb_ext); | |
| 234 } | |
| 235 EnableDisable(GL_POLYGON_OFFSET_FILL, | 222 EnableDisable(GL_POLYGON_OFFSET_FILL, |
| 236 enable_flags.cached_polygon_offset_fill); | 223 enable_flags.cached_polygon_offset_fill); |
| 237 EnableDisable(GL_SAMPLE_ALPHA_TO_COVERAGE, | 224 EnableDisable(GL_SAMPLE_ALPHA_TO_COVERAGE, |
| 238 enable_flags.cached_sample_alpha_to_coverage); | 225 enable_flags.cached_sample_alpha_to_coverage); |
| 239 EnableDisable(GL_SAMPLE_COVERAGE, enable_flags.cached_sample_coverage); | 226 EnableDisable(GL_SAMPLE_COVERAGE, enable_flags.cached_sample_coverage); |
| 240 EnableDisable(GL_SCISSOR_TEST, enable_flags.cached_scissor_test); | 227 EnableDisable(GL_SCISSOR_TEST, enable_flags.cached_scissor_test); |
| 241 EnableDisable(GL_STENCIL_TEST, enable_flags.cached_stencil_test); | 228 EnableDisable(GL_STENCIL_TEST, enable_flags.cached_stencil_test); |
| 242 if (feature_info_->feature_flags().ext_multisample_compatibility) { | 229 if (feature_info_->feature_flags().ext_multisample_compatibility) { |
| 243 EnableDisable(GL_MULTISAMPLE_EXT, enable_flags.cached_multisample_ext); | 230 EnableDisable(GL_MULTISAMPLE_EXT, enable_flags.cached_multisample_ext); |
| 244 } | 231 } |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 bool ContextState::GetEnabled(GLenum cap) const { | 426 bool ContextState::GetEnabled(GLenum cap) const { |
| 440 switch (cap) { | 427 switch (cap) { |
| 441 case GL_BLEND: | 428 case GL_BLEND: |
| 442 return enable_flags.blend; | 429 return enable_flags.blend; |
| 443 case GL_CULL_FACE: | 430 case GL_CULL_FACE: |
| 444 return enable_flags.cull_face; | 431 return enable_flags.cull_face; |
| 445 case GL_DEPTH_TEST: | 432 case GL_DEPTH_TEST: |
| 446 return enable_flags.depth_test; | 433 return enable_flags.depth_test; |
| 447 case GL_DITHER: | 434 case GL_DITHER: |
| 448 return enable_flags.dither; | 435 return enable_flags.dither; |
| 449 case GL_FRAMEBUFFER_SRGB_EXT: | |
| 450 return enable_flags.framebuffer_srgb_ext; | |
| 451 case GL_POLYGON_OFFSET_FILL: | 436 case GL_POLYGON_OFFSET_FILL: |
| 452 return enable_flags.polygon_offset_fill; | 437 return enable_flags.polygon_offset_fill; |
| 453 case GL_SAMPLE_ALPHA_TO_COVERAGE: | 438 case GL_SAMPLE_ALPHA_TO_COVERAGE: |
| 454 return enable_flags.sample_alpha_to_coverage; | 439 return enable_flags.sample_alpha_to_coverage; |
| 455 case GL_SAMPLE_COVERAGE: | 440 case GL_SAMPLE_COVERAGE: |
| 456 return enable_flags.sample_coverage; | 441 return enable_flags.sample_coverage; |
| 457 case GL_SCISSOR_TEST: | 442 case GL_SCISSOR_TEST: |
| 458 return enable_flags.scissor_test; | 443 return enable_flags.scissor_test; |
| 459 case GL_STENCIL_TEST: | 444 case GL_STENCIL_TEST: |
| 460 return enable_flags.stencil_test; | 445 return enable_flags.stencil_test; |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 if (params) { | 828 if (params) { |
| 844 params[0] = static_cast<GLint>(enable_flags.depth_test); | 829 params[0] = static_cast<GLint>(enable_flags.depth_test); |
| 845 } | 830 } |
| 846 return true; | 831 return true; |
| 847 case GL_DITHER: | 832 case GL_DITHER: |
| 848 *num_written = 1; | 833 *num_written = 1; |
| 849 if (params) { | 834 if (params) { |
| 850 params[0] = static_cast<GLint>(enable_flags.dither); | 835 params[0] = static_cast<GLint>(enable_flags.dither); |
| 851 } | 836 } |
| 852 return true; | 837 return true; |
| 853 case GL_FRAMEBUFFER_SRGB_EXT: | |
| 854 *num_written = 1; | |
| 855 if (params) { | |
| 856 params[0] = static_cast<GLint>(enable_flags.framebuffer_srgb_ext); | |
| 857 } | |
| 858 return true; | |
| 859 case GL_POLYGON_OFFSET_FILL: | 838 case GL_POLYGON_OFFSET_FILL: |
| 860 *num_written = 1; | 839 *num_written = 1; |
| 861 if (params) { | 840 if (params) { |
| 862 params[0] = static_cast<GLint>(enable_flags.polygon_offset_fill); | 841 params[0] = static_cast<GLint>(enable_flags.polygon_offset_fill); |
| 863 } | 842 } |
| 864 return true; | 843 return true; |
| 865 case GL_SAMPLE_ALPHA_TO_COVERAGE: | 844 case GL_SAMPLE_ALPHA_TO_COVERAGE: |
| 866 *num_written = 1; | 845 *num_written = 1; |
| 867 if (params) { | 846 if (params) { |
| 868 params[0] = static_cast<GLint>(enable_flags.sample_alpha_to_coverage); | 847 params[0] = static_cast<GLint>(enable_flags.sample_alpha_to_coverage); |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1283 if (params) { | 1262 if (params) { |
| 1284 params[0] = static_cast<GLfloat>(enable_flags.depth_test); | 1263 params[0] = static_cast<GLfloat>(enable_flags.depth_test); |
| 1285 } | 1264 } |
| 1286 return true; | 1265 return true; |
| 1287 case GL_DITHER: | 1266 case GL_DITHER: |
| 1288 *num_written = 1; | 1267 *num_written = 1; |
| 1289 if (params) { | 1268 if (params) { |
| 1290 params[0] = static_cast<GLfloat>(enable_flags.dither); | 1269 params[0] = static_cast<GLfloat>(enable_flags.dither); |
| 1291 } | 1270 } |
| 1292 return true; | 1271 return true; |
| 1293 case GL_FRAMEBUFFER_SRGB_EXT: | |
| 1294 *num_written = 1; | |
| 1295 if (params) { | |
| 1296 params[0] = static_cast<GLfloat>(enable_flags.framebuffer_srgb_ext); | |
| 1297 } | |
| 1298 return true; | |
| 1299 case GL_POLYGON_OFFSET_FILL: | 1272 case GL_POLYGON_OFFSET_FILL: |
| 1300 *num_written = 1; | 1273 *num_written = 1; |
| 1301 if (params) { | 1274 if (params) { |
| 1302 params[0] = static_cast<GLfloat>(enable_flags.polygon_offset_fill); | 1275 params[0] = static_cast<GLfloat>(enable_flags.polygon_offset_fill); |
| 1303 } | 1276 } |
| 1304 return true; | 1277 return true; |
| 1305 case GL_SAMPLE_ALPHA_TO_COVERAGE: | 1278 case GL_SAMPLE_ALPHA_TO_COVERAGE: |
| 1306 *num_written = 1; | 1279 *num_written = 1; |
| 1307 if (params) { | 1280 if (params) { |
| 1308 params[0] = static_cast<GLfloat>(enable_flags.sample_alpha_to_coverage); | 1281 params[0] = static_cast<GLfloat>(enable_flags.sample_alpha_to_coverage); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1349 *num_written = 1; | 1322 *num_written = 1; |
| 1350 if (params) { | 1323 if (params) { |
| 1351 params[0] = static_cast<GLfloat>(enable_flags.sample_alpha_to_one_ext); | 1324 params[0] = static_cast<GLfloat>(enable_flags.sample_alpha_to_one_ext); |
| 1352 } | 1325 } |
| 1353 return true; | 1326 return true; |
| 1354 default: | 1327 default: |
| 1355 return false; | 1328 return false; |
| 1356 } | 1329 } |
| 1357 } | 1330 } |
| 1358 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ | 1331 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ |
| OLD | NEW |