| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 float v[4]; | 92 float v[4]; |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 struct GPU_EXPORT ContextState { | 95 struct GPU_EXPORT ContextState { |
| 96 ContextState(FeatureInfo* feature_info, Logger* logger); | 96 ContextState(FeatureInfo* feature_info, Logger* logger); |
| 97 ~ContextState(); | 97 ~ContextState(); |
| 98 | 98 |
| 99 void Initialize(); | 99 void Initialize(); |
| 100 | 100 |
| 101 void RestoreState() const; | 101 void RestoreState(const ContextState* prev_state) const; |
| 102 void InitCapabilities() const; | 102 void InitCapabilities() const; |
| 103 void InitState() const; | 103 void InitState() const; |
| 104 | 104 |
| 105 void RestoreActiveTexture() const; | 105 void RestoreActiveTexture() const; |
| 106 void RestoreAllTextureUnitBindings() const; | 106 void RestoreAllTextureUnitBindings(const ContextState* prev_state) const; |
| 107 void RestoreAttribute(GLuint index) const; | 107 void RestoreAttribute(GLuint index) const; |
| 108 void RestoreBufferBindings() const; | 108 void RestoreBufferBindings() const; |
| 109 void RestoreGlobalState() const; | 109 void RestoreGlobalState() const; |
| 110 void RestoreProgramBindings() const; | 110 void RestoreProgramBindings() const; |
| 111 void RestoreRenderbufferBindings() const; | 111 void RestoreRenderbufferBindings() const; |
| 112 void RestoreTextureUnitBindings(GLuint unit) const; | 112 void RestoreTextureUnitBindings(GLuint unit) const; |
| 113 | 113 |
| 114 // Helper for getting cached state. | 114 // Helper for getting cached state. |
| 115 bool GetStateAsGLint( | 115 bool GetStateAsGLint( |
| 116 GLenum pname, GLint* params, GLsizei* num_written) const; | 116 GLenum pname, GLint* params, GLsizei* num_written) const; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // The currently bound renderbuffer | 148 // The currently bound renderbuffer |
| 149 scoped_refptr<Renderbuffer> bound_renderbuffer; | 149 scoped_refptr<Renderbuffer> bound_renderbuffer; |
| 150 | 150 |
| 151 scoped_refptr<QueryManager::Query> current_query; | 151 scoped_refptr<QueryManager::Query> current_query; |
| 152 | 152 |
| 153 bool pack_reverse_row_order; | 153 bool pack_reverse_row_order; |
| 154 | 154 |
| 155 mutable bool fbo_binding_for_scissor_workaround_dirty_; | 155 mutable bool fbo_binding_for_scissor_workaround_dirty_; |
| 156 FeatureInfo* feature_info_; | 156 FeatureInfo* feature_info_; |
| 157 | 157 |
| 158 // Maximum active texture unit index in this context. |
| 159 GLuint max_active_texture_unit_; |
| 160 |
| 158 private: | 161 private: |
| 159 scoped_ptr<ErrorState> error_state_; | 162 scoped_ptr<ErrorState> error_state_; |
| 160 }; | 163 }; |
| 161 | 164 |
| 162 } // namespace gles2 | 165 } // namespace gles2 |
| 163 } // namespace gpu | 166 } // namespace gpu |
| 164 | 167 |
| 165 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 168 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ |
| 166 | 169 |
| OLD | NEW |