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

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

Issue 15792007: gpu: Autogenerate glHint state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch-case instead of if-series. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 color_mask_red = true; 42 color_mask_red = true;
43 color_mask_green = true; 43 color_mask_green = true;
44 color_mask_blue = true; 44 color_mask_blue = true;
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;
53 hint_fragment_shader_derivative = GL_DONT_CARE;
52 line_width = 1.0f; 54 line_width = 1.0f;
53 polygon_offset_factor = 0.0f; 55 polygon_offset_factor = 0.0f;
54 polygon_offset_units = 0.0f; 56 polygon_offset_units = 0.0f;
55 sample_coverage_value = 1.0f; 57 sample_coverage_value = 1.0f;
56 sample_coverage_invert = false; 58 sample_coverage_invert = false;
57 scissor_x = 0; 59 scissor_x = 0;
58 scissor_y = 0; 60 scissor_y = 0;
59 scissor_width = 1; 61 scissor_width = 1;
60 scissor_height = 1; 62 scissor_height = 1;
61 stencil_front_func = GL_ALWAYS; 63 stencil_front_func = GL_ALWAYS;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 color_clear_red, color_clear_green, color_clear_blue, color_clear_alpha); 103 color_clear_red, color_clear_green, color_clear_blue, color_clear_alpha);
102 glClearDepth(depth_clear); 104 glClearDepth(depth_clear);
103 glClearStencil(stencil_clear); 105 glClearStencil(stencil_clear);
104 glColorMask( 106 glColorMask(
105 color_mask_red, color_mask_green, color_mask_blue, color_mask_alpha); 107 color_mask_red, color_mask_green, color_mask_blue, color_mask_alpha);
106 glCullFace(cull_mode); 108 glCullFace(cull_mode);
107 glDepthFunc(depth_func); 109 glDepthFunc(depth_func);
108 glDepthMask(depth_mask); 110 glDepthMask(depth_mask);
109 glDepthRange(z_near, z_far); 111 glDepthRange(z_near, z_far);
110 glFrontFace(front_face); 112 glFrontFace(front_face);
113 glHint(GL_GENERATE_MIPMAP_HINT, hint_generate_mipmap);
114 if (feature_info_->feature_flags().oes_standard_derivatives)
115 glHint(
116 GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES, hint_fragment_shader_derivative);
111 glLineWidth(line_width); 117 glLineWidth(line_width);
112 glPolygonOffset(polygon_offset_factor, polygon_offset_units); 118 glPolygonOffset(polygon_offset_factor, polygon_offset_units);
113 glSampleCoverage(sample_coverage_value, sample_coverage_invert); 119 glSampleCoverage(sample_coverage_value, sample_coverage_invert);
114 glScissor(scissor_x, scissor_y, scissor_width, scissor_height); 120 glScissor(scissor_x, scissor_y, scissor_width, scissor_height);
115 glStencilFuncSeparate( 121 glStencilFuncSeparate(
116 GL_FRONT, stencil_front_func, stencil_front_ref, stencil_front_mask); 122 GL_FRONT, stencil_front_func, stencil_front_ref, stencil_front_mask);
117 glStencilFuncSeparate( 123 glStencilFuncSeparate(
118 GL_BACK, stencil_back_func, stencil_back_ref, stencil_back_mask); 124 GL_BACK, stencil_back_func, stencil_back_ref, stencil_back_mask);
119 glStencilMaskSeparate(GL_FRONT, stencil_front_writemask); 125 glStencilMaskSeparate(GL_FRONT, stencil_front_writemask);
120 glStencilMaskSeparate(GL_BACK, stencil_back_writemask); 126 glStencilMaskSeparate(GL_BACK, stencil_back_writemask);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 params[2] = static_cast<GLint>(blend_color_blue); 208 params[2] = static_cast<GLint>(blend_color_blue);
203 params[3] = static_cast<GLint>(blend_color_alpha); 209 params[3] = static_cast<GLint>(blend_color_alpha);
204 } 210 }
205 return true; 211 return true;
206 case GL_STENCIL_CLEAR_VALUE: 212 case GL_STENCIL_CLEAR_VALUE:
207 *num_written = 1; 213 *num_written = 1;
208 if (params) { 214 if (params) {
209 params[0] = static_cast<GLint>(stencil_clear); 215 params[0] = static_cast<GLint>(stencil_clear);
210 } 216 }
211 return true; 217 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;
212 case GL_COLOR_WRITEMASK: 230 case GL_COLOR_WRITEMASK:
213 *num_written = 4; 231 *num_written = 4;
214 if (params) { 232 if (params) {
215 params[0] = static_cast<GLint>(color_mask_red); 233 params[0] = static_cast<GLint>(color_mask_red);
216 params[1] = static_cast<GLint>(color_mask_green); 234 params[1] = static_cast<GLint>(color_mask_green);
217 params[2] = static_cast<GLint>(color_mask_blue); 235 params[2] = static_cast<GLint>(color_mask_blue);
218 params[3] = static_cast<GLint>(color_mask_alpha); 236 params[3] = static_cast<GLint>(color_mask_alpha);
219 } 237 }
220 return true; 238 return true;
221 case GL_COLOR_CLEAR_VALUE: 239 case GL_COLOR_CLEAR_VALUE:
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 params[2] = static_cast<GLfloat>(blend_color_blue); 520 params[2] = static_cast<GLfloat>(blend_color_blue);
503 params[3] = static_cast<GLfloat>(blend_color_alpha); 521 params[3] = static_cast<GLfloat>(blend_color_alpha);
504 } 522 }
505 return true; 523 return true;
506 case GL_STENCIL_CLEAR_VALUE: 524 case GL_STENCIL_CLEAR_VALUE:
507 *num_written = 1; 525 *num_written = 1;
508 if (params) { 526 if (params) {
509 params[0] = static_cast<GLfloat>(stencil_clear); 527 params[0] = static_cast<GLfloat>(stencil_clear);
510 } 528 }
511 return true; 529 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;
512 case GL_COLOR_WRITEMASK: 542 case GL_COLOR_WRITEMASK:
513 *num_written = 4; 543 *num_written = 4;
514 if (params) { 544 if (params) {
515 params[0] = static_cast<GLfloat>(color_mask_red); 545 params[0] = static_cast<GLfloat>(color_mask_red);
516 params[1] = static_cast<GLfloat>(color_mask_green); 546 params[1] = static_cast<GLfloat>(color_mask_green);
517 params[2] = static_cast<GLfloat>(color_mask_blue); 547 params[2] = static_cast<GLfloat>(color_mask_blue);
518 params[3] = static_cast<GLfloat>(color_mask_alpha); 548 params[3] = static_cast<GLfloat>(color_mask_alpha);
519 } 549 }
520 return true; 550 return true;
521 case GL_COLOR_CLEAR_VALUE: 551 case GL_COLOR_CLEAR_VALUE:
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 if (params) { 777 if (params) {
748 params[0] = static_cast<GLfloat>(enable_flags.stencil_test); 778 params[0] = static_cast<GLfloat>(enable_flags.stencil_test);
749 } 779 }
750 return true; 780 return true;
751 default: 781 default:
752 return false; 782 return false;
753 } 783 }
754 } 784 }
755 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ 785 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_
756 786
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/context_state_autogen.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698