Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(998)

Side by Side Diff: gpu/command_buffer/client/client_context_state_impl_autogen.h

Issue 11363191: Cache more GL state both service and client side. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py
7 // DO NOT EDIT!
8
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_
12
13 ClientContextState::EnableFlags::EnableFlags()
14 : blend(false),
15 cull_face(false),
16 depth_test(false),
17 dither(true),
18 polygon_offset_fill(false),
19 sample_alpha_to_coverage(false),
20 sample_coverage(false),
21 scissor_test(false),
22 stencil_test(false) {
23 }
24
25
26 bool ClientContextState::SetCapabilityState(
27 GLenum cap, bool enabled, bool* changed) {
28 *changed = false;
29 switch (cap) {
30 case GL_BLEND:
31 if (enable_flags.blend != enabled) {
32 *changed = true;
33 enable_flags.blend = enabled;
34 }
35 return true;
36 case GL_CULL_FACE:
37 if (enable_flags.cull_face != enabled) {
38 *changed = true;
39 enable_flags.cull_face = enabled;
40 }
41 return true;
42 case GL_DEPTH_TEST:
43 if (enable_flags.depth_test != enabled) {
44 *changed = true;
45 enable_flags.depth_test = enabled;
46 }
47 return true;
48 case GL_DITHER:
49 if (enable_flags.dither != enabled) {
50 *changed = true;
51 enable_flags.dither = enabled;
52 }
53 return true;
54 case GL_POLYGON_OFFSET_FILL:
55 if (enable_flags.polygon_offset_fill != enabled) {
56 *changed = true;
57 enable_flags.polygon_offset_fill = enabled;
58 }
59 return true;
60 case GL_SAMPLE_ALPHA_TO_COVERAGE:
61 if (enable_flags.sample_alpha_to_coverage != enabled) {
62 *changed = true;
63 enable_flags.sample_alpha_to_coverage = enabled;
64 }
65 return true;
66 case GL_SAMPLE_COVERAGE:
67 if (enable_flags.sample_coverage != enabled) {
68 *changed = true;
69 enable_flags.sample_coverage = enabled;
70 }
71 return true;
72 case GL_SCISSOR_TEST:
73 if (enable_flags.scissor_test != enabled) {
74 *changed = true;
75 enable_flags.scissor_test = enabled;
76 }
77 return true;
78 case GL_STENCIL_TEST:
79 if (enable_flags.stencil_test != enabled) {
80 *changed = true;
81 enable_flags.stencil_test = enabled;
82 }
83 return true;
84 default:
85 return false;
86 }
87 }
88 bool ClientContextState::GetEnabled(
89 GLenum cap, bool* enabled) const {
90 switch (cap) {
91 case GL_BLEND:
92 *enabled = enable_flags.blend;
93 return true;
94 case GL_CULL_FACE:
95 *enabled = enable_flags.cull_face;
96 return true;
97 case GL_DEPTH_TEST:
98 *enabled = enable_flags.depth_test;
99 return true;
100 case GL_DITHER:
101 *enabled = enable_flags.dither;
102 return true;
103 case GL_POLYGON_OFFSET_FILL:
104 *enabled = enable_flags.polygon_offset_fill;
105 return true;
106 case GL_SAMPLE_ALPHA_TO_COVERAGE:
107 *enabled = enable_flags.sample_alpha_to_coverage;
108 return true;
109 case GL_SAMPLE_COVERAGE:
110 *enabled = enable_flags.sample_coverage;
111 return true;
112 case GL_SCISSOR_TEST:
113 *enabled = enable_flags.scissor_test;
114 return true;
115 case GL_STENCIL_TEST:
116 *enabled = enable_flags.stencil_test;
117 return true;
118 default:
119 return false;
120 }
121 }
122 #endif // GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_IMPL_AUTOGEN_H_
123
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/client_context_state_autogen.h ('k') | gpu/command_buffer/client/gles2_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698