Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / gpu / command_buffer / client / client_context_state_impl_autogen.h
blob036f92ccdc958291ac4f37ebf0d7326c821d33ac
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) {
29 bool ClientContextState::SetCapabilityState(GLenum cap,
30 bool enabled,
31 bool* changed) {
32 *changed = false;
33 switch (cap) {
34 case GL_BLEND:
35 if (enable_flags.blend != enabled) {
36 *changed = true;
37 enable_flags.blend = enabled;
39 return true;
40 case GL_CULL_FACE:
41 if (enable_flags.cull_face != enabled) {
42 *changed = true;
43 enable_flags.cull_face = enabled;
45 return true;
46 case GL_DEPTH_TEST:
47 if (enable_flags.depth_test != enabled) {
48 *changed = true;
49 enable_flags.depth_test = enabled;
51 return true;
52 case GL_DITHER:
53 if (enable_flags.dither != enabled) {
54 *changed = true;
55 enable_flags.dither = enabled;
57 return true;
58 case GL_POLYGON_OFFSET_FILL:
59 if (enable_flags.polygon_offset_fill != enabled) {
60 *changed = true;
61 enable_flags.polygon_offset_fill = enabled;
63 return true;
64 case GL_SAMPLE_ALPHA_TO_COVERAGE:
65 if (enable_flags.sample_alpha_to_coverage != enabled) {
66 *changed = true;
67 enable_flags.sample_alpha_to_coverage = enabled;
69 return true;
70 case GL_SAMPLE_COVERAGE:
71 if (enable_flags.sample_coverage != enabled) {
72 *changed = true;
73 enable_flags.sample_coverage = enabled;
75 return true;
76 case GL_SCISSOR_TEST:
77 if (enable_flags.scissor_test != enabled) {
78 *changed = true;
79 enable_flags.scissor_test = enabled;
81 return true;
82 case GL_STENCIL_TEST:
83 if (enable_flags.stencil_test != enabled) {
84 *changed = true;
85 enable_flags.stencil_test = enabled;
87 return true;
88 case GL_RASTERIZER_DISCARD:
89 if (enable_flags.rasterizer_discard != enabled) {
90 *changed = true;
91 enable_flags.rasterizer_discard = enabled;
93 return true;
94 case GL_PRIMITIVE_RESTART_FIXED_INDEX:
95 if (enable_flags.primitive_restart_fixed_index != enabled) {
96 *changed = true;
97 enable_flags.primitive_restart_fixed_index = enabled;
99 return true;
100 default:
101 return false;
104 bool ClientContextState::GetEnabled(GLenum cap, bool* enabled) const {
105 switch (cap) {
106 case GL_BLEND:
107 *enabled = enable_flags.blend;
108 return true;
109 case GL_CULL_FACE:
110 *enabled = enable_flags.cull_face;
111 return true;
112 case GL_DEPTH_TEST:
113 *enabled = enable_flags.depth_test;
114 return true;
115 case GL_DITHER:
116 *enabled = enable_flags.dither;
117 return true;
118 case GL_POLYGON_OFFSET_FILL:
119 *enabled = enable_flags.polygon_offset_fill;
120 return true;
121 case GL_SAMPLE_ALPHA_TO_COVERAGE:
122 *enabled = enable_flags.sample_alpha_to_coverage;
123 return true;
124 case GL_SAMPLE_COVERAGE:
125 *enabled = enable_flags.sample_coverage;
126 return true;
127 case GL_SCISSOR_TEST:
128 *enabled = enable_flags.scissor_test;
129 return true;
130 case GL_STENCIL_TEST:
131 *enabled = enable_flags.stencil_test;
132 return true;
133 case GL_RASTERIZER_DISCARD:
134 *enabled = enable_flags.rasterizer_discard;
135 return true;
136 case GL_PRIMITIVE_RESTART_FIXED_INDEX:
137 *enabled = enable_flags.primitive_restart_fixed_index;
138 return true;
139 default:
140 return false;
143 #endif // GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_IMPL_AUTOGEN_H_