OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file contains the ContextState class. | 5 // This file contains the ContextState class. |
6 | 6 |
7 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ |
8 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 8 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 GPU_EXPORT void Vec4::GetValues<GLuint>(GLuint* values) const; | 131 GPU_EXPORT void Vec4::GetValues<GLuint>(GLuint* values) const; |
132 | 132 |
133 template <> | 133 template <> |
134 GPU_EXPORT void Vec4::SetValues<GLfloat>(const GLfloat* values); | 134 GPU_EXPORT void Vec4::SetValues<GLfloat>(const GLfloat* values); |
135 template <> | 135 template <> |
136 GPU_EXPORT void Vec4::SetValues<GLint>(const GLint* values); | 136 GPU_EXPORT void Vec4::SetValues<GLint>(const GLint* values); |
137 template <> | 137 template <> |
138 GPU_EXPORT void Vec4::SetValues<GLuint>(const GLuint* values); | 138 GPU_EXPORT void Vec4::SetValues<GLuint>(const GLuint* values); |
139 | 139 |
140 struct GPU_EXPORT ContextState { | 140 struct GPU_EXPORT ContextState { |
| 141 enum Dimension { |
| 142 k2D, |
| 143 k3D |
| 144 }; |
| 145 |
141 ContextState(FeatureInfo* feature_info, | 146 ContextState(FeatureInfo* feature_info, |
142 ErrorStateClient* error_state_client, | 147 ErrorStateClient* error_state_client, |
143 Logger* logger); | 148 Logger* logger); |
144 ~ContextState(); | 149 ~ContextState(); |
145 | 150 |
146 void Initialize(); | 151 void Initialize(); |
147 | 152 |
148 void SetIgnoreCachedStateForTest(bool ignore) { | 153 void SetIgnoreCachedStateForTest(bool ignore) { |
149 ignore_cached_state = ignore; | 154 ignore_cached_state = ignore; |
150 } | 155 } |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 } | 218 } |
214 | 219 |
215 ErrorState* GetErrorState(); | 220 ErrorState* GetErrorState(); |
216 | 221 |
217 void SetBoundBuffer(GLenum target, Buffer* buffer); | 222 void SetBoundBuffer(GLenum target, Buffer* buffer); |
218 void RemoveBoundBuffer(Buffer* buffer); | 223 void RemoveBoundBuffer(Buffer* buffer); |
219 | 224 |
220 void UnbindTexture(TextureRef* texture); | 225 void UnbindTexture(TextureRef* texture); |
221 void UnbindSampler(Sampler* sampler); | 226 void UnbindSampler(Sampler* sampler); |
222 | 227 |
| 228 PixelStoreParams GetPackParams(); |
| 229 PixelStoreParams GetUnpackParams(Dimension dimension); |
| 230 |
223 #include "gpu/command_buffer/service/context_state_autogen.h" | 231 #include "gpu/command_buffer/service/context_state_autogen.h" |
224 | 232 |
225 EnableFlags enable_flags; | 233 EnableFlags enable_flags; |
226 | 234 |
227 // Current active texture by 0 - n index. | 235 // Current active texture by 0 - n index. |
228 // In other words, if we call glActiveTexture(GL_TEXTURE2) this value would | 236 // In other words, if we call glActiveTexture(GL_TEXTURE2) this value would |
229 // be 2. | 237 // be 2. |
230 GLuint active_texture_unit; | 238 GLuint active_texture_unit; |
231 | 239 |
232 // The currently bound array buffer. If this is 0 it is illegal to call | 240 // The currently bound array buffer. If this is 0 it is illegal to call |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 288 |
281 FeatureInfo* feature_info_; | 289 FeatureInfo* feature_info_; |
282 scoped_ptr<ErrorState> error_state_; | 290 scoped_ptr<ErrorState> error_state_; |
283 }; | 291 }; |
284 | 292 |
285 } // namespace gles2 | 293 } // namespace gles2 |
286 } // namespace gpu | 294 } // namespace gpu |
287 | 295 |
288 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 296 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ |
289 | 297 |
OLD | NEW |