| 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 | |
| 146 ContextState(FeatureInfo* feature_info, | 141 ContextState(FeatureInfo* feature_info, |
| 147 ErrorStateClient* error_state_client, | 142 ErrorStateClient* error_state_client, |
| 148 Logger* logger); | 143 Logger* logger); |
| 149 ~ContextState(); | 144 ~ContextState(); |
| 150 | 145 |
| 151 void Initialize(); | 146 void Initialize(); |
| 152 | 147 |
| 153 void SetIgnoreCachedStateForTest(bool ignore) { | 148 void SetIgnoreCachedStateForTest(bool ignore) { |
| 154 ignore_cached_state = ignore; | 149 ignore_cached_state = ignore; |
| 155 } | 150 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 213 } |
| 219 | 214 |
| 220 ErrorState* GetErrorState(); | 215 ErrorState* GetErrorState(); |
| 221 | 216 |
| 222 void SetBoundBuffer(GLenum target, Buffer* buffer); | 217 void SetBoundBuffer(GLenum target, Buffer* buffer); |
| 223 void RemoveBoundBuffer(Buffer* buffer); | 218 void RemoveBoundBuffer(Buffer* buffer); |
| 224 | 219 |
| 225 void UnbindTexture(TextureRef* texture); | 220 void UnbindTexture(TextureRef* texture); |
| 226 void UnbindSampler(Sampler* sampler); | 221 void UnbindSampler(Sampler* sampler); |
| 227 | 222 |
| 228 PixelStoreParams GetPackParams(); | |
| 229 PixelStoreParams GetUnpackParams(Dimension dimension); | |
| 230 | |
| 231 #include "gpu/command_buffer/service/context_state_autogen.h" | 223 #include "gpu/command_buffer/service/context_state_autogen.h" |
| 232 | 224 |
| 233 EnableFlags enable_flags; | 225 EnableFlags enable_flags; |
| 234 | 226 |
| 235 // Current active texture by 0 - n index. | 227 // Current active texture by 0 - n index. |
| 236 // In other words, if we call glActiveTexture(GL_TEXTURE2) this value would | 228 // In other words, if we call glActiveTexture(GL_TEXTURE2) this value would |
| 237 // be 2. | 229 // be 2. |
| 238 GLuint active_texture_unit; | 230 GLuint active_texture_unit; |
| 239 | 231 |
| 240 // The currently bound array buffer. If this is 0 it is illegal to call | 232 // 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... |
| 288 | 280 |
| 289 FeatureInfo* feature_info_; | 281 FeatureInfo* feature_info_; |
| 290 scoped_ptr<ErrorState> error_state_; | 282 scoped_ptr<ErrorState> error_state_; |
| 291 }; | 283 }; |
| 292 | 284 |
| 293 } // namespace gles2 | 285 } // namespace gles2 |
| 294 } // namespace gpu | 286 } // namespace gpu |
| 295 | 287 |
| 296 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 288 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ |
| 297 | 289 |
| OLD | NEW |