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