Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / gpu / command_buffer / client / client_context_state_impl_autogen.h
blob203c8d377503d6c1ba77be8f3d9e9d9608f25361
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
9 // DO NOT EDIT!
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()
16 : blend(false),
17 cull_face(false),
18 depth_test(false),
19 dither(true),
20 polygon_offset_fill(false),
21 sample_alpha_to_coverage(false),
22 sample_coverage(false),
23 scissor_test(false),
24 stencil_test(false),
25 rasterizer_discard(false),
26 primitive_restart_fixed_index(false) {}
28 bool ClientContextState::SetCapabilityState(GLenum cap,
29 bool enabled,
30 bool* changed) {
31 *changed = false;
32 switch (cap) {
33 case GL_BLEND:
34 if (enable_flags.blend != enabled) {
35 *changed = true;
36 enable_flags.blend = enabled;
38 return true;
39 case GL_CULL_FACE:
40 if (enable_flags.cull_face != enabled) {
41 *changed = true;
42 enable_flags.cull_face = enabled;
44 return true;
45 case GL_DEPTH_TEST:
46 if (enable_flags.depth_test != enabled) {
47 *changed = true;
48 enable_flags.depth_test = enabled;
50 return true;
51 case GL_DITHER:
52 if (enable_flags.dither != enabled) {
53 *changed = true;
54 enable_flags.dither = enabled;
56 return true;
57 case GL_POLYGON_OFFSET_FILL:
58 if (enable_flags.polygon_offset_fill != enabled) {
59 *changed = true;
60 enable_flags.polygon_offset_fill = enabled;
62 return true;
63 case GL_SAMPLE_ALPHA_TO_COVERAGE:
64 if (enable_flags.sample_alpha_to_coverage != enabled) {
65 *changed = true;
66 enable_flags.sample_alpha_to_coverage = enabled;
68 return true;
69 case GL_SAMPLE_COVERAGE:
70 if (enable_flags.sample_coverage != enabled) {
71 *changed = true;
72 enable_flags.sample_coverage = enabled;
74 return true;
75 case GL_SCISSOR_TEST:
76 if (enable_flags.scissor_test != enabled) {
77 *changed = true;
78 enable_flags.scissor_test = enabled;
80 return true;
81 case GL_STENCIL_TEST:
82 if (enable_flags.stencil_test != enabled) {
83 *changed = true;
84 enable_flags.stencil_test = enabled;
86 return true;
87 case GL_RASTERIZER_DISCARD:
88 if (enable_flags.rasterizer_discard != enabled) {
89 *changed = true;
90 enable_flags.rasterizer_discard = enabled;
92 return true;
93 case GL_PRIMITIVE_RESTART_FIXED_INDEX:
94 if (enable_flags.primitive_restart_fixed_index != enabled) {
95 *changed = true;
96 enable_flags.primitive_restart_fixed_index = enabled;
98 return true;
99 default:
100 return false;
103 bool ClientContextState::GetEnabled(GLenum cap, bool* enabled) const {
104 switch (cap) {
105 case GL_BLEND:
106 *enabled = enable_flags.blend;
107 return true;
108 case GL_CULL_FACE:
109 *enabled = enable_flags.cull_face;
110 return true;
111 case GL_DEPTH_TEST:
112 *enabled = enable_flags.depth_test;
113 return true;
114 case GL_DITHER:
115 *enabled = enable_flags.dither;
116 return true;
117 case GL_POLYGON_OFFSET_FILL:
118 *enabled = enable_flags.polygon_offset_fill;
119 return true;
120 case GL_SAMPLE_ALPHA_TO_COVERAGE:
121 *enabled = enable_flags.sample_alpha_to_coverage;
122 return true;
123 case GL_SAMPLE_COVERAGE:
124 *enabled = enable_flags.sample_coverage;
125 return true;
126 case GL_SCISSOR_TEST:
127 *enabled = enable_flags.scissor_test;
128 return true;
129 case GL_STENCIL_TEST:
130 *enabled = enable_flags.stencil_test;
131 return true;
132 case GL_RASTERIZER_DISCARD:
133 *enabled = enable_flags.rasterizer_discard;
134 return true;
135 case GL_PRIMITIVE_RESTART_FIXED_INDEX:
136 *enabled = enable_flags.primitive_restart_fixed_index;
137 return true;
138 default:
139 return false;
142 #endif // GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_IMPL_AUTOGEN_H_