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
3 // found in the LICENSE file.
5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py
7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename
11 // It is included by client_context_state.cc
12 #ifndef GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_IMPL_AUTOGEN_H_
13 #define GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_IMPL_AUTOGEN_H_
15 ClientContextState::EnableFlags::EnableFlags()
20 polygon_offset_fill(false),
21 sample_alpha_to_coverage(false),
22 sample_coverage(false),
25 rasterizer_discard(false),
26 primitive_restart_fixed_index(false) {
29 bool ClientContextState::SetCapabilityState(GLenum cap
,
35 if (enable_flags
.blend
!= enabled
) {
37 enable_flags
.blend
= enabled
;
41 if (enable_flags
.cull_face
!= enabled
) {
43 enable_flags
.cull_face
= enabled
;
47 if (enable_flags
.depth_test
!= enabled
) {
49 enable_flags
.depth_test
= enabled
;
53 if (enable_flags
.dither
!= enabled
) {
55 enable_flags
.dither
= enabled
;
58 case GL_POLYGON_OFFSET_FILL
:
59 if (enable_flags
.polygon_offset_fill
!= enabled
) {
61 enable_flags
.polygon_offset_fill
= enabled
;
64 case GL_SAMPLE_ALPHA_TO_COVERAGE
:
65 if (enable_flags
.sample_alpha_to_coverage
!= enabled
) {
67 enable_flags
.sample_alpha_to_coverage
= enabled
;
70 case GL_SAMPLE_COVERAGE
:
71 if (enable_flags
.sample_coverage
!= enabled
) {
73 enable_flags
.sample_coverage
= enabled
;
77 if (enable_flags
.scissor_test
!= enabled
) {
79 enable_flags
.scissor_test
= enabled
;
83 if (enable_flags
.stencil_test
!= enabled
) {
85 enable_flags
.stencil_test
= enabled
;
88 case GL_RASTERIZER_DISCARD
:
89 if (enable_flags
.rasterizer_discard
!= enabled
) {
91 enable_flags
.rasterizer_discard
= enabled
;
94 case GL_PRIMITIVE_RESTART_FIXED_INDEX
:
95 if (enable_flags
.primitive_restart_fixed_index
!= enabled
) {
97 enable_flags
.primitive_restart_fixed_index
= enabled
;
104 bool ClientContextState::GetEnabled(GLenum cap
, bool* enabled
) const {
107 *enabled
= enable_flags
.blend
;
110 *enabled
= enable_flags
.cull_face
;
113 *enabled
= enable_flags
.depth_test
;
116 *enabled
= enable_flags
.dither
;
118 case GL_POLYGON_OFFSET_FILL
:
119 *enabled
= enable_flags
.polygon_offset_fill
;
121 case GL_SAMPLE_ALPHA_TO_COVERAGE
:
122 *enabled
= enable_flags
.sample_alpha_to_coverage
;
124 case GL_SAMPLE_COVERAGE
:
125 *enabled
= enable_flags
.sample_coverage
;
127 case GL_SCISSOR_TEST
:
128 *enabled
= enable_flags
.scissor_test
;
130 case GL_STENCIL_TEST
:
131 *enabled
= enable_flags
.stencil_test
;
133 case GL_RASTERIZER_DISCARD
:
134 *enabled
= enable_flags
.rasterizer_discard
;
136 case GL_PRIMITIVE_RESTART_FIXED_INDEX
:
137 *enabled
= enable_flags
.primitive_restart_fixed_index
;
143 #endif // GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_IMPL_AUTOGEN_H_