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

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

Issue 1135943002: Pull in various gpu/command_buffer fixes from chromium (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 14 matching lines...) Expand all
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), 34 rasterizer_discard(false),
35 cached_rasterizer_discard(false) { 35 cached_rasterizer_discard(false),
36 primitive_restart_fixed_index(false),
37 cached_primitive_restart_fixed_index(false) {
36 } 38 }
37 39
38 void ContextState::Initialize() { 40 void ContextState::Initialize() {
39 blend_color_red = 0.0f; 41 blend_color_red = 0.0f;
40 blend_color_green = 0.0f; 42 blend_color_green = 0.0f;
41 blend_color_blue = 0.0f; 43 blend_color_blue = 0.0f;
42 blend_color_alpha = 0.0f; 44 blend_color_alpha = 0.0f;
43 blend_equation_rgb = GL_FUNC_ADD; 45 blend_equation_rgb = GL_FUNC_ADD;
44 blend_equation_alpha = GL_FUNC_ADD; 46 blend_equation_alpha = GL_FUNC_ADD;
45 blend_source_rgb = GL_ONE; 47 blend_source_rgb = GL_ONE;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 if (prev_state->enable_flags.cached_stencil_test != 173 if (prev_state->enable_flags.cached_stencil_test !=
172 enable_flags.cached_stencil_test) { 174 enable_flags.cached_stencil_test) {
173 EnableDisable(GL_STENCIL_TEST, enable_flags.cached_stencil_test); 175 EnableDisable(GL_STENCIL_TEST, enable_flags.cached_stencil_test);
174 } 176 }
175 if (feature_info_->IsES3Capable()) { 177 if (feature_info_->IsES3Capable()) {
176 if (prev_state->enable_flags.cached_rasterizer_discard != 178 if (prev_state->enable_flags.cached_rasterizer_discard !=
177 enable_flags.cached_rasterizer_discard) { 179 enable_flags.cached_rasterizer_discard) {
178 EnableDisable(GL_RASTERIZER_DISCARD, 180 EnableDisable(GL_RASTERIZER_DISCARD,
179 enable_flags.cached_rasterizer_discard); 181 enable_flags.cached_rasterizer_discard);
180 } 182 }
183 if (prev_state->enable_flags.cached_primitive_restart_fixed_index !=
184 enable_flags.cached_primitive_restart_fixed_index) {
185 EnableDisable(GL_PRIMITIVE_RESTART_FIXED_INDEX,
186 enable_flags.cached_primitive_restart_fixed_index);
187 }
181 } 188 }
182 } else { 189 } else {
183 EnableDisable(GL_BLEND, enable_flags.cached_blend); 190 EnableDisable(GL_BLEND, enable_flags.cached_blend);
184 EnableDisable(GL_CULL_FACE, enable_flags.cached_cull_face); 191 EnableDisable(GL_CULL_FACE, enable_flags.cached_cull_face);
185 EnableDisable(GL_DEPTH_TEST, enable_flags.cached_depth_test); 192 EnableDisable(GL_DEPTH_TEST, enable_flags.cached_depth_test);
186 EnableDisable(GL_DITHER, enable_flags.cached_dither); 193 EnableDisable(GL_DITHER, enable_flags.cached_dither);
187 EnableDisable(GL_POLYGON_OFFSET_FILL, 194 EnableDisable(GL_POLYGON_OFFSET_FILL,
188 enable_flags.cached_polygon_offset_fill); 195 enable_flags.cached_polygon_offset_fill);
189 EnableDisable(GL_SAMPLE_ALPHA_TO_COVERAGE, 196 EnableDisable(GL_SAMPLE_ALPHA_TO_COVERAGE,
190 enable_flags.cached_sample_alpha_to_coverage); 197 enable_flags.cached_sample_alpha_to_coverage);
191 EnableDisable(GL_SAMPLE_COVERAGE, enable_flags.cached_sample_coverage); 198 EnableDisable(GL_SAMPLE_COVERAGE, enable_flags.cached_sample_coverage);
192 EnableDisable(GL_SCISSOR_TEST, enable_flags.cached_scissor_test); 199 EnableDisable(GL_SCISSOR_TEST, enable_flags.cached_scissor_test);
193 EnableDisable(GL_STENCIL_TEST, enable_flags.cached_stencil_test); 200 EnableDisable(GL_STENCIL_TEST, enable_flags.cached_stencil_test);
194 if (feature_info_->IsES3Capable()) { 201 if (feature_info_->IsES3Capable()) {
195 EnableDisable(GL_RASTERIZER_DISCARD, 202 EnableDisable(GL_RASTERIZER_DISCARD,
196 enable_flags.cached_rasterizer_discard); 203 enable_flags.cached_rasterizer_discard);
204 EnableDisable(GL_PRIMITIVE_RESTART_FIXED_INDEX,
205 enable_flags.cached_primitive_restart_fixed_index);
197 } 206 }
198 } 207 }
199 } 208 }
200 209
201 void ContextState::InitState(const ContextState* prev_state) const { 210 void ContextState::InitState(const ContextState* prev_state) const {
202 if (prev_state) { 211 if (prev_state) {
203 if ((blend_color_red != prev_state->blend_color_red) || 212 if ((blend_color_red != prev_state->blend_color_red) ||
204 (blend_color_green != prev_state->blend_color_green) || 213 (blend_color_green != prev_state->blend_color_green) ||
205 (blend_color_blue != prev_state->blend_color_blue) || 214 (blend_color_blue != prev_state->blend_color_blue) ||
206 (blend_color_alpha != prev_state->blend_color_alpha)) 215 (blend_color_alpha != prev_state->blend_color_alpha))
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 case GL_SAMPLE_ALPHA_TO_COVERAGE: 384 case GL_SAMPLE_ALPHA_TO_COVERAGE:
376 return enable_flags.sample_alpha_to_coverage; 385 return enable_flags.sample_alpha_to_coverage;
377 case GL_SAMPLE_COVERAGE: 386 case GL_SAMPLE_COVERAGE:
378 return enable_flags.sample_coverage; 387 return enable_flags.sample_coverage;
379 case GL_SCISSOR_TEST: 388 case GL_SCISSOR_TEST:
380 return enable_flags.scissor_test; 389 return enable_flags.scissor_test;
381 case GL_STENCIL_TEST: 390 case GL_STENCIL_TEST:
382 return enable_flags.stencil_test; 391 return enable_flags.stencil_test;
383 case GL_RASTERIZER_DISCARD: 392 case GL_RASTERIZER_DISCARD:
384 return enable_flags.rasterizer_discard; 393 return enable_flags.rasterizer_discard;
394 case GL_PRIMITIVE_RESTART_FIXED_INDEX:
395 return enable_flags.primitive_restart_fixed_index;
385 default: 396 default:
386 NOTREACHED(); 397 NOTREACHED();
387 return false; 398 return false;
388 } 399 }
389 } 400 }
390 401
391 bool ContextState::GetStateAsGLint(GLenum pname, 402 bool ContextState::GetStateAsGLint(GLenum pname,
392 GLint* params, 403 GLint* params,
393 GLsizei* num_written) const { 404 GLsizei* num_written) const {
394 switch (pname) { 405 switch (pname) {
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 if (params) { 734 if (params) {
724 params[0] = static_cast<GLint>(enable_flags.stencil_test); 735 params[0] = static_cast<GLint>(enable_flags.stencil_test);
725 } 736 }
726 return true; 737 return true;
727 case GL_RASTERIZER_DISCARD: 738 case GL_RASTERIZER_DISCARD:
728 *num_written = 1; 739 *num_written = 1;
729 if (params) { 740 if (params) {
730 params[0] = static_cast<GLint>(enable_flags.rasterizer_discard); 741 params[0] = static_cast<GLint>(enable_flags.rasterizer_discard);
731 } 742 }
732 return true; 743 return true;
744 case GL_PRIMITIVE_RESTART_FIXED_INDEX:
745 *num_written = 1;
746 if (params) {
747 params[0] =
748 static_cast<GLint>(enable_flags.primitive_restart_fixed_index);
749 }
750 return true;
733 default: 751 default:
734 return false; 752 return false;
735 } 753 }
736 } 754 }
737 755
738 bool ContextState::GetStateAsGLfloat(GLenum pname, 756 bool ContextState::GetStateAsGLfloat(GLenum pname,
739 GLfloat* params, 757 GLfloat* params,
740 GLsizei* num_written) const { 758 GLsizei* num_written) const {
741 switch (pname) { 759 switch (pname) {
742 case GL_BLEND_COLOR: 760 case GL_BLEND_COLOR:
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 if (params) { 1084 if (params) {
1067 params[0] = static_cast<GLfloat>(enable_flags.stencil_test); 1085 params[0] = static_cast<GLfloat>(enable_flags.stencil_test);
1068 } 1086 }
1069 return true; 1087 return true;
1070 case GL_RASTERIZER_DISCARD: 1088 case GL_RASTERIZER_DISCARD:
1071 *num_written = 1; 1089 *num_written = 1;
1072 if (params) { 1090 if (params) {
1073 params[0] = static_cast<GLfloat>(enable_flags.rasterizer_discard); 1091 params[0] = static_cast<GLfloat>(enable_flags.rasterizer_discard);
1074 } 1092 }
1075 return true; 1093 return true;
1094 case GL_PRIMITIVE_RESTART_FIXED_INDEX:
1095 *num_written = 1;
1096 if (params) {
1097 params[0] =
1098 static_cast<GLfloat>(enable_flags.primitive_restart_fixed_index);
1099 }
1100 return true;
1076 default: 1101 default:
1077 return false; 1102 return false;
1078 } 1103 }
1079 } 1104 }
1080 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ 1105 #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/feature_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698