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) {}
28 bool ClientContextState::SetCapabilityState(GLenum cap
,
34 if (enable_flags
.blend
!= enabled
) {
36 enable_flags
.blend
= enabled
;
40 if (enable_flags
.cull_face
!= enabled
) {
42 enable_flags
.cull_face
= enabled
;
46 if (enable_flags
.depth_test
!= enabled
) {
48 enable_flags
.depth_test
= enabled
;
52 if (enable_flags
.dither
!= enabled
) {
54 enable_flags
.dither
= enabled
;
57 case GL_POLYGON_OFFSET_FILL
:
58 if (enable_flags
.polygon_offset_fill
!= enabled
) {
60 enable_flags
.polygon_offset_fill
= enabled
;
63 case GL_SAMPLE_ALPHA_TO_COVERAGE
:
64 if (enable_flags
.sample_alpha_to_coverage
!= enabled
) {
66 enable_flags
.sample_alpha_to_coverage
= enabled
;
69 case GL_SAMPLE_COVERAGE
:
70 if (enable_flags
.sample_coverage
!= enabled
) {
72 enable_flags
.sample_coverage
= enabled
;
76 if (enable_flags
.scissor_test
!= enabled
) {
78 enable_flags
.scissor_test
= enabled
;
82 if (enable_flags
.stencil_test
!= enabled
) {
84 enable_flags
.stencil_test
= enabled
;
87 case GL_RASTERIZER_DISCARD
:
88 if (enable_flags
.rasterizer_discard
!= enabled
) {
90 enable_flags
.rasterizer_discard
= enabled
;
93 case GL_PRIMITIVE_RESTART_FIXED_INDEX
:
94 if (enable_flags
.primitive_restart_fixed_index
!= enabled
) {
96 enable_flags
.primitive_restart_fixed_index
= enabled
;
103 bool ClientContextState::GetEnabled(GLenum cap
, bool* enabled
) const {
106 *enabled
= enable_flags
.blend
;
109 *enabled
= enable_flags
.cull_face
;
112 *enabled
= enable_flags
.depth_test
;
115 *enabled
= enable_flags
.dither
;
117 case GL_POLYGON_OFFSET_FILL
:
118 *enabled
= enable_flags
.polygon_offset_fill
;
120 case GL_SAMPLE_ALPHA_TO_COVERAGE
:
121 *enabled
= enable_flags
.sample_alpha_to_coverage
;
123 case GL_SAMPLE_COVERAGE
:
124 *enabled
= enable_flags
.sample_coverage
;
126 case GL_SCISSOR_TEST
:
127 *enabled
= enable_flags
.scissor_test
;
129 case GL_STENCIL_TEST
:
130 *enabled
= enable_flags
.stencil_test
;
132 case GL_RASTERIZER_DISCARD
:
133 *enabled
= enable_flags
.rasterizer_discard
;
135 case GL_PRIMITIVE_RESTART_FIXED_INDEX
:
136 *enabled
= enable_flags
.primitive_restart_fixed_index
;
142 #endif // GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_IMPL_AUTOGEN_H_