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 <memory> | 10 #include <memory> |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 204 |
205 void SetIgnoreCachedStateForTest(bool ignore) { | 205 void SetIgnoreCachedStateForTest(bool ignore) { |
206 ignore_cached_state = ignore; | 206 ignore_cached_state = ignore; |
207 } | 207 } |
208 | 208 |
209 void RestoreState(const ContextState* prev_state); | 209 void RestoreState(const ContextState* prev_state); |
210 void InitCapabilities(const ContextState* prev_state) const; | 210 void InitCapabilities(const ContextState* prev_state) const; |
211 void InitState(const ContextState* prev_state) const; | 211 void InitState(const ContextState* prev_state) const; |
212 | 212 |
213 void RestoreActiveTexture() const; | 213 void RestoreActiveTexture() const; |
214 void RestoreAllTextureUnitBindings(const ContextState* prev_state) const; | 214 void RestoreAllTextureUnitAndSamplerBindings( |
| 215 const ContextState* prev_state) const; |
215 void RestoreActiveTextureUnitBinding(unsigned int target) const; | 216 void RestoreActiveTextureUnitBinding(unsigned int target) const; |
216 void RestoreVertexAttribValues() const; | 217 void RestoreVertexAttribValues() const; |
217 void RestoreVertexAttribArrays( | 218 void RestoreVertexAttribArrays( |
218 const scoped_refptr<VertexAttribManager> attrib_manager) const; | 219 const scoped_refptr<VertexAttribManager> attrib_manager) const; |
219 void RestoreVertexAttribs() const; | 220 void RestoreVertexAttribs() const; |
220 void RestoreBufferBindings() const; | 221 void RestoreBufferBindings() const; |
221 void RestoreGlobalState(const ContextState* prev_state) const; | 222 void RestoreGlobalState(const ContextState* prev_state) const; |
222 void RestoreProgramSettings(const ContextState* prev_state, | 223 void RestoreProgramSettings(const ContextState* prev_state, |
223 bool restore_transform_feedback_bindings) const; | 224 bool restore_transform_feedback_bindings) const; |
224 void RestoreRenderbufferBindings(); | 225 void RestoreRenderbufferBindings(); |
225 void RestoreIndexedUniformBufferBindings(const ContextState* prev_state); | 226 void RestoreIndexedUniformBufferBindings(const ContextState* prev_state); |
226 void RestoreTextureUnitBindings( | 227 void RestoreTextureUnitBindings( |
227 GLuint unit, const ContextState* prev_state) const; | 228 GLuint unit, const ContextState* prev_state) const; |
| 229 void RestoreSamplerBinding(GLuint unit, const ContextState* prev_state) const; |
228 | 230 |
229 void PushTextureDecompressionUnpackState() const; | 231 void PushTextureDecompressionUnpackState() const; |
230 void RestoreUnpackState() const; | 232 void RestoreUnpackState() const; |
231 void DoLineWidth(GLfloat width) const; | 233 void DoLineWidth(GLfloat width) const; |
232 | 234 |
233 // Helper for getting cached state. | 235 // Helper for getting cached state. |
234 bool GetStateAsGLint( | 236 bool GetStateAsGLint( |
235 GLenum pname, GLint* params, GLsizei* num_written) const; | 237 GLenum pname, GLint* params, GLsizei* num_written) const; |
236 bool GetStateAsGLfloat( | 238 bool GetStateAsGLfloat( |
237 GLenum pname, GLfloat* params, GLsizei* num_written) const; | 239 GLenum pname, GLfloat* params, GLsizei* num_written) const; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 GLfloat line_width_max_ = 1.0f; | 395 GLfloat line_width_max_ = 1.0f; |
394 | 396 |
395 FeatureInfo* feature_info_; | 397 FeatureInfo* feature_info_; |
396 std::unique_ptr<ErrorState> error_state_; | 398 std::unique_ptr<ErrorState> error_state_; |
397 }; | 399 }; |
398 | 400 |
399 } // namespace gles2 | 401 } // namespace gles2 |
400 } // namespace gpu | 402 } // namespace gpu |
401 | 403 |
402 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 404 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ |
OLD | NEW |