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

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

Issue 1028333002: Chromium -> Mojo roll. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
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
(...skipping 12 matching lines...) Expand all
23 cached_dither(true), 23 cached_dither(true),
24 polygon_offset_fill(false), 24 polygon_offset_fill(false),
25 cached_polygon_offset_fill(false), 25 cached_polygon_offset_fill(false),
26 sample_alpha_to_coverage(false), 26 sample_alpha_to_coverage(false),
27 cached_sample_alpha_to_coverage(false), 27 cached_sample_alpha_to_coverage(false),
28 sample_coverage(false), 28 sample_coverage(false),
29 cached_sample_coverage(false), 29 cached_sample_coverage(false),
30 scissor_test(false), 30 scissor_test(false),
31 cached_scissor_test(false), 31 cached_scissor_test(false),
32 stencil_test(false), 32 stencil_test(false),
33 cached_stencil_test(false) { 33 cached_stencil_test(false),
34 rasterizer_discard(false),
35 cached_rasterizer_discard(false) {
34 } 36 }
35 37
36 void ContextState::Initialize() { 38 void ContextState::Initialize() {
37 blend_color_red = 0.0f; 39 blend_color_red = 0.0f;
38 blend_color_green = 0.0f; 40 blend_color_green = 0.0f;
39 blend_color_blue = 0.0f; 41 blend_color_blue = 0.0f;
40 blend_color_alpha = 0.0f; 42 blend_color_alpha = 0.0f;
41 blend_equation_rgb = GL_FUNC_ADD; 43 blend_equation_rgb = GL_FUNC_ADD;
42 blend_equation_alpha = GL_FUNC_ADD; 44 blend_equation_alpha = GL_FUNC_ADD;
43 blend_source_rgb = GL_ONE; 45 blend_source_rgb = GL_ONE;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 stencil_back_z_fail_op = GL_KEEP; 129 stencil_back_z_fail_op = GL_KEEP;
128 stencil_back_z_pass_op = GL_KEEP; 130 stencil_back_z_pass_op = GL_KEEP;
129 viewport_x = 0; 131 viewport_x = 0;
130 viewport_y = 0; 132 viewport_y = 0;
131 viewport_width = 1; 133 viewport_width = 1;
132 viewport_height = 1; 134 viewport_height = 1;
133 } 135 }
134 136
135 void ContextState::InitCapabilities(const ContextState* prev_state) const { 137 void ContextState::InitCapabilities(const ContextState* prev_state) const {
136 if (prev_state) { 138 if (prev_state) {
137 if (prev_state->enable_flags.cached_blend != enable_flags.cached_blend) 139 if (prev_state->enable_flags.cached_blend != enable_flags.cached_blend) {
138 EnableDisable(GL_BLEND, enable_flags.cached_blend); 140 EnableDisable(GL_BLEND, enable_flags.cached_blend);
141 }
139 if (prev_state->enable_flags.cached_cull_face != 142 if (prev_state->enable_flags.cached_cull_face !=
140 enable_flags.cached_cull_face) 143 enable_flags.cached_cull_face) {
141 EnableDisable(GL_CULL_FACE, enable_flags.cached_cull_face); 144 EnableDisable(GL_CULL_FACE, enable_flags.cached_cull_face);
145 }
142 if (prev_state->enable_flags.cached_depth_test != 146 if (prev_state->enable_flags.cached_depth_test !=
143 enable_flags.cached_depth_test) 147 enable_flags.cached_depth_test) {
144 EnableDisable(GL_DEPTH_TEST, enable_flags.cached_depth_test); 148 EnableDisable(GL_DEPTH_TEST, enable_flags.cached_depth_test);
145 if (prev_state->enable_flags.cached_dither != enable_flags.cached_dither) 149 }
150 if (prev_state->enable_flags.cached_dither != enable_flags.cached_dither) {
146 EnableDisable(GL_DITHER, enable_flags.cached_dither); 151 EnableDisable(GL_DITHER, enable_flags.cached_dither);
152 }
147 if (prev_state->enable_flags.cached_polygon_offset_fill != 153 if (prev_state->enable_flags.cached_polygon_offset_fill !=
148 enable_flags.cached_polygon_offset_fill) 154 enable_flags.cached_polygon_offset_fill) {
149 EnableDisable(GL_POLYGON_OFFSET_FILL, 155 EnableDisable(GL_POLYGON_OFFSET_FILL,
150 enable_flags.cached_polygon_offset_fill); 156 enable_flags.cached_polygon_offset_fill);
157 }
151 if (prev_state->enable_flags.cached_sample_alpha_to_coverage != 158 if (prev_state->enable_flags.cached_sample_alpha_to_coverage !=
152 enable_flags.cached_sample_alpha_to_coverage) 159 enable_flags.cached_sample_alpha_to_coverage) {
153 EnableDisable(GL_SAMPLE_ALPHA_TO_COVERAGE, 160 EnableDisable(GL_SAMPLE_ALPHA_TO_COVERAGE,
154 enable_flags.cached_sample_alpha_to_coverage); 161 enable_flags.cached_sample_alpha_to_coverage);
162 }
155 if (prev_state->enable_flags.cached_sample_coverage != 163 if (prev_state->enable_flags.cached_sample_coverage !=
156 enable_flags.cached_sample_coverage) 164 enable_flags.cached_sample_coverage) {
157 EnableDisable(GL_SAMPLE_COVERAGE, enable_flags.cached_sample_coverage); 165 EnableDisable(GL_SAMPLE_COVERAGE, enable_flags.cached_sample_coverage);
166 }
158 if (prev_state->enable_flags.cached_scissor_test != 167 if (prev_state->enable_flags.cached_scissor_test !=
159 enable_flags.cached_scissor_test) 168 enable_flags.cached_scissor_test) {
160 EnableDisable(GL_SCISSOR_TEST, enable_flags.cached_scissor_test); 169 EnableDisable(GL_SCISSOR_TEST, enable_flags.cached_scissor_test);
170 }
161 if (prev_state->enable_flags.cached_stencil_test != 171 if (prev_state->enable_flags.cached_stencil_test !=
162 enable_flags.cached_stencil_test) 172 enable_flags.cached_stencil_test) {
163 EnableDisable(GL_STENCIL_TEST, enable_flags.cached_stencil_test); 173 EnableDisable(GL_STENCIL_TEST, enable_flags.cached_stencil_test);
174 }
175 if (feature_info_->IsES3Capable()) {
176 if (prev_state->enable_flags.cached_rasterizer_discard !=
177 enable_flags.cached_rasterizer_discard) {
178 EnableDisable(GL_RASTERIZER_DISCARD,
179 enable_flags.cached_rasterizer_discard);
180 }
181 }
164 } else { 182 } else {
165 EnableDisable(GL_BLEND, enable_flags.cached_blend); 183 EnableDisable(GL_BLEND, enable_flags.cached_blend);
166 EnableDisable(GL_CULL_FACE, enable_flags.cached_cull_face); 184 EnableDisable(GL_CULL_FACE, enable_flags.cached_cull_face);
167 EnableDisable(GL_DEPTH_TEST, enable_flags.cached_depth_test); 185 EnableDisable(GL_DEPTH_TEST, enable_flags.cached_depth_test);
168 EnableDisable(GL_DITHER, enable_flags.cached_dither); 186 EnableDisable(GL_DITHER, enable_flags.cached_dither);
169 EnableDisable(GL_POLYGON_OFFSET_FILL, 187 EnableDisable(GL_POLYGON_OFFSET_FILL,
170 enable_flags.cached_polygon_offset_fill); 188 enable_flags.cached_polygon_offset_fill);
171 EnableDisable(GL_SAMPLE_ALPHA_TO_COVERAGE, 189 EnableDisable(GL_SAMPLE_ALPHA_TO_COVERAGE,
172 enable_flags.cached_sample_alpha_to_coverage); 190 enable_flags.cached_sample_alpha_to_coverage);
173 EnableDisable(GL_SAMPLE_COVERAGE, enable_flags.cached_sample_coverage); 191 EnableDisable(GL_SAMPLE_COVERAGE, enable_flags.cached_sample_coverage);
174 EnableDisable(GL_SCISSOR_TEST, enable_flags.cached_scissor_test); 192 EnableDisable(GL_SCISSOR_TEST, enable_flags.cached_scissor_test);
175 EnableDisable(GL_STENCIL_TEST, enable_flags.cached_stencil_test); 193 EnableDisable(GL_STENCIL_TEST, enable_flags.cached_stencil_test);
194 if (feature_info_->IsES3Capable()) {
195 EnableDisable(GL_RASTERIZER_DISCARD,
196 enable_flags.cached_rasterizer_discard);
197 }
176 } 198 }
177 } 199 }
178 200
179 void ContextState::InitState(const ContextState* prev_state) const { 201 void ContextState::InitState(const ContextState* prev_state) const {
180 if (prev_state) { 202 if (prev_state) {
181 if ((blend_color_red != prev_state->blend_color_red) || 203 if ((blend_color_red != prev_state->blend_color_red) ||
182 (blend_color_green != prev_state->blend_color_green) || 204 (blend_color_green != prev_state->blend_color_green) ||
183 (blend_color_blue != prev_state->blend_color_blue) || 205 (blend_color_blue != prev_state->blend_color_blue) ||
184 (blend_color_alpha != prev_state->blend_color_alpha)) 206 (blend_color_alpha != prev_state->blend_color_alpha))
185 glBlendColor(blend_color_red, blend_color_green, blend_color_blue, 207 glBlendColor(blend_color_red, blend_color_green, blend_color_blue,
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 case GL_POLYGON_OFFSET_FILL: 373 case GL_POLYGON_OFFSET_FILL:
352 return enable_flags.polygon_offset_fill; 374 return enable_flags.polygon_offset_fill;
353 case GL_SAMPLE_ALPHA_TO_COVERAGE: 375 case GL_SAMPLE_ALPHA_TO_COVERAGE:
354 return enable_flags.sample_alpha_to_coverage; 376 return enable_flags.sample_alpha_to_coverage;
355 case GL_SAMPLE_COVERAGE: 377 case GL_SAMPLE_COVERAGE:
356 return enable_flags.sample_coverage; 378 return enable_flags.sample_coverage;
357 case GL_SCISSOR_TEST: 379 case GL_SCISSOR_TEST:
358 return enable_flags.scissor_test; 380 return enable_flags.scissor_test;
359 case GL_STENCIL_TEST: 381 case GL_STENCIL_TEST:
360 return enable_flags.stencil_test; 382 return enable_flags.stencil_test;
383 case GL_RASTERIZER_DISCARD:
384 return enable_flags.rasterizer_discard;
361 default: 385 default:
362 NOTREACHED(); 386 NOTREACHED();
363 return false; 387 return false;
364 } 388 }
365 } 389 }
366 390
367 bool ContextState::GetStateAsGLint(GLenum pname, 391 bool ContextState::GetStateAsGLint(GLenum pname,
368 GLint* params, 392 GLint* params,
369 GLsizei* num_written) const { 393 GLsizei* num_written) const {
370 switch (pname) { 394 switch (pname) {
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 if (params) { 717 if (params) {
694 params[0] = static_cast<GLint>(enable_flags.scissor_test); 718 params[0] = static_cast<GLint>(enable_flags.scissor_test);
695 } 719 }
696 return true; 720 return true;
697 case GL_STENCIL_TEST: 721 case GL_STENCIL_TEST:
698 *num_written = 1; 722 *num_written = 1;
699 if (params) { 723 if (params) {
700 params[0] = static_cast<GLint>(enable_flags.stencil_test); 724 params[0] = static_cast<GLint>(enable_flags.stencil_test);
701 } 725 }
702 return true; 726 return true;
727 case GL_RASTERIZER_DISCARD:
728 *num_written = 1;
729 if (params) {
730 params[0] = static_cast<GLint>(enable_flags.rasterizer_discard);
731 }
732 return true;
703 default: 733 default:
704 return false; 734 return false;
705 } 735 }
706 } 736 }
707 737
708 bool ContextState::GetStateAsGLfloat(GLenum pname, 738 bool ContextState::GetStateAsGLfloat(GLenum pname,
709 GLfloat* params, 739 GLfloat* params,
710 GLsizei* num_written) const { 740 GLsizei* num_written) const {
711 switch (pname) { 741 switch (pname) {
712 case GL_BLEND_COLOR: 742 case GL_BLEND_COLOR:
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 if (params) { 1060 if (params) {
1031 params[0] = static_cast<GLfloat>(enable_flags.scissor_test); 1061 params[0] = static_cast<GLfloat>(enable_flags.scissor_test);
1032 } 1062 }
1033 return true; 1063 return true;
1034 case GL_STENCIL_TEST: 1064 case GL_STENCIL_TEST:
1035 *num_written = 1; 1065 *num_written = 1;
1036 if (params) { 1066 if (params) {
1037 params[0] = static_cast<GLfloat>(enable_flags.stencil_test); 1067 params[0] = static_cast<GLfloat>(enable_flags.stencil_test);
1038 } 1068 }
1039 return true; 1069 return true;
1070 case GL_RASTERIZER_DISCARD:
1071 *num_written = 1;
1072 if (params) {
1073 params[0] = static_cast<GLfloat>(enable_flags.rasterizer_discard);
1074 }
1075 return true;
1040 default: 1076 default:
1041 return false; 1077 return false;
1042 } 1078 }
1043 } 1079 }
1044 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ 1080 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_
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