| 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> |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "gpu/command_buffer/service/gl_utils.h" | 13 #include "gpu/command_buffer/service/gl_utils.h" |
| 14 #include "gpu/command_buffer/service/sampler_manager.h" |
| 14 #include "gpu/command_buffer/service/texture_manager.h" | 15 #include "gpu/command_buffer/service/texture_manager.h" |
| 15 #include "gpu/command_buffer/service/valuebuffer_manager.h" | 16 #include "gpu/command_buffer/service/valuebuffer_manager.h" |
| 16 #include "gpu/command_buffer/service/vertex_attrib_manager.h" | 17 #include "gpu/command_buffer/service/vertex_attrib_manager.h" |
| 17 #include "gpu/command_buffer/service/vertex_array_manager.h" | 18 #include "gpu/command_buffer/service/vertex_array_manager.h" |
| 18 #include "gpu/gpu_export.h" | 19 #include "gpu/gpu_export.h" |
| 19 | 20 |
| 20 namespace gpu { | 21 namespace gpu { |
| 21 namespace gles2 { | 22 namespace gles2 { |
| 22 | 23 |
| 23 class Buffer; | 24 class Buffer; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 } | 211 } |
| 211 glStencilMaskSeparate(op, mask); | 212 glStencilMaskSeparate(op, mask); |
| 212 } | 213 } |
| 213 | 214 |
| 214 ErrorState* GetErrorState(); | 215 ErrorState* GetErrorState(); |
| 215 | 216 |
| 216 void SetBoundBuffer(GLenum target, Buffer* buffer); | 217 void SetBoundBuffer(GLenum target, Buffer* buffer); |
| 217 void RemoveBoundBuffer(Buffer* buffer); | 218 void RemoveBoundBuffer(Buffer* buffer); |
| 218 | 219 |
| 219 void UnbindTexture(TextureRef* texture); | 220 void UnbindTexture(TextureRef* texture); |
| 221 void UnbindSampler(Sampler* sampler); |
| 220 | 222 |
| 221 #include "gpu/command_buffer/service/context_state_autogen.h" | 223 #include "gpu/command_buffer/service/context_state_autogen.h" |
| 222 | 224 |
| 223 EnableFlags enable_flags; | 225 EnableFlags enable_flags; |
| 224 | 226 |
| 225 // Current active texture by 0 - n index. | 227 // Current active texture by 0 - n index. |
| 226 // 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 |
| 227 // be 2. | 229 // be 2. |
| 228 GLuint active_texture_unit; | 230 GLuint active_texture_unit; |
| 229 | 231 |
| 230 // 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 |
| 231 // glVertexAttribPointer. | 233 // glVertexAttribPointer. |
| 232 scoped_refptr<Buffer> bound_array_buffer; | 234 scoped_refptr<Buffer> bound_array_buffer; |
| 233 | 235 |
| 234 scoped_refptr<Buffer> bound_copy_read_buffer; | 236 scoped_refptr<Buffer> bound_copy_read_buffer; |
| 235 scoped_refptr<Buffer> bound_copy_write_buffer; | 237 scoped_refptr<Buffer> bound_copy_write_buffer; |
| 236 scoped_refptr<Buffer> bound_pixel_pack_buffer; | 238 scoped_refptr<Buffer> bound_pixel_pack_buffer; |
| 237 scoped_refptr<Buffer> bound_pixel_unpack_buffer; | 239 scoped_refptr<Buffer> bound_pixel_unpack_buffer; |
| 238 scoped_refptr<Buffer> bound_transform_feedback_buffer; | 240 scoped_refptr<Buffer> bound_transform_feedback_buffer; |
| 239 scoped_refptr<Buffer> bound_uniform_buffer; | 241 scoped_refptr<Buffer> bound_uniform_buffer; |
| 240 | 242 |
| 241 // Which textures are bound to texture units through glActiveTexture. | 243 // Which textures are bound to texture units through glActiveTexture. |
| 242 std::vector<TextureUnit> texture_units; | 244 std::vector<TextureUnit> texture_units; |
| 243 | 245 |
| 246 // Which samplers are bound to each texture unit; |
| 247 std::vector<scoped_refptr<Sampler> > sampler_units; |
| 248 |
| 244 // The values for each attrib. | 249 // The values for each attrib. |
| 245 std::vector<Vec4> attrib_values; | 250 std::vector<Vec4> attrib_values; |
| 246 | 251 |
| 247 // Class that manages vertex attribs. | 252 // Class that manages vertex attribs. |
| 248 scoped_refptr<VertexAttribManager> vertex_attrib_manager; | 253 scoped_refptr<VertexAttribManager> vertex_attrib_manager; |
| 249 scoped_refptr<VertexAttribManager> default_vertex_attrib_manager; | 254 scoped_refptr<VertexAttribManager> default_vertex_attrib_manager; |
| 250 | 255 |
| 251 // The program in use by glUseProgram | 256 // The program in use by glUseProgram |
| 252 scoped_refptr<Program> current_program; | 257 scoped_refptr<Program> current_program; |
| 253 | 258 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 275 | 280 |
| 276 FeatureInfo* feature_info_; | 281 FeatureInfo* feature_info_; |
| 277 scoped_ptr<ErrorState> error_state_; | 282 scoped_ptr<ErrorState> error_state_; |
| 278 }; | 283 }; |
| 279 | 284 |
| 280 } // namespace gles2 | 285 } // namespace gles2 |
| 281 } // namespace gpu | 286 } // namespace gpu |
| 282 | 287 |
| 283 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 288 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ |
| 284 | 289 |
| OLD | NEW |