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
3 // found in the LICENSE file.
5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py
9 // It is included by client_context_state.cc
10 #ifndef GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_IMPL_AUTOGEN_H_
11 #define GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_IMPL_AUTOGEN_H_
13 ClientContextState::EnableFlags::EnableFlags()
18 polygon_offset_fill(false),
19 sample_alpha_to_coverage(false),
20 sample_coverage(false),
26 bool ClientContextState::SetCapabilityState(
27 GLenum cap
, bool enabled
, bool* changed
) {
31 if (enable_flags
.blend
!= enabled
) {
33 enable_flags
.blend
= enabled
;
37 if (enable_flags
.cull_face
!= enabled
) {
39 enable_flags
.cull_face
= enabled
;
43 if (enable_flags
.depth_test
!= enabled
) {
45 enable_flags
.depth_test
= enabled
;
49 if (enable_flags
.dither
!= enabled
) {
51 enable_flags
.dither
= enabled
;
54 case GL_POLYGON_OFFSET_FILL
:
55 if (enable_flags
.polygon_offset_fill
!= enabled
) {
57 enable_flags
.polygon_offset_fill
= enabled
;
60 case GL_SAMPLE_ALPHA_TO_COVERAGE
:
61 if (enable_flags
.sample_alpha_to_coverage
!= enabled
) {
63 enable_flags
.sample_alpha_to_coverage
= enabled
;
66 case GL_SAMPLE_COVERAGE
:
67 if (enable_flags
.sample_coverage
!= enabled
) {
69 enable_flags
.sample_coverage
= enabled
;
73 if (enable_flags
.scissor_test
!= enabled
) {
75 enable_flags
.scissor_test
= enabled
;
79 if (enable_flags
.stencil_test
!= enabled
) {
81 enable_flags
.stencil_test
= enabled
;
88 bool ClientContextState::GetEnabled(
89 GLenum cap
, bool* enabled
) const {
92 *enabled
= enable_flags
.blend
;
95 *enabled
= enable_flags
.cull_face
;
98 *enabled
= enable_flags
.depth_test
;
101 *enabled
= enable_flags
.dither
;
103 case GL_POLYGON_OFFSET_FILL
:
104 *enabled
= enable_flags
.polygon_offset_fill
;
106 case GL_SAMPLE_ALPHA_TO_COVERAGE
:
107 *enabled
= enable_flags
.sample_alpha_to_coverage
;
109 case GL_SAMPLE_COVERAGE
:
110 *enabled
= enable_flags
.sample_coverage
;
112 case GL_SCISSOR_TEST
:
113 *enabled
= enable_flags
.scissor_test
;
115 case GL_STENCIL_TEST
:
116 *enabled
= enable_flags
.stencil_test
;
122 #endif // GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_IMPL_AUTOGEN_H_