| 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 #ifndef GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "gpu/command_buffer/service/common_decoder.h" | 15 #include "gpu/command_buffer/service/common_decoder.h" |
| 16 #include "gpu/command_buffer/service/gl_utils.h" | 16 #include "gpu/command_buffer/service/gl_utils.h" |
| 17 #include "gpu/command_buffer/service/shader_manager.h" | 17 #include "gpu/command_buffer/service/shader_manager.h" |
| 18 #include "gpu/gpu_export.h" |
| 18 | 19 |
| 19 namespace gpu { | 20 namespace gpu { |
| 20 namespace gles2 { | 21 namespace gles2 { |
| 21 | 22 |
| 22 // Tracks the Programs. | 23 // Tracks the Programs. |
| 23 // | 24 // |
| 24 // NOTE: To support shared resources an instance of this class will | 25 // NOTE: To support shared resources an instance of this class will |
| 25 // need to be shared by multiple GLES2Decoders. | 26 // need to be shared by multiple GLES2Decoders. |
| 26 class ProgramManager { | 27 class GPU_EXPORT ProgramManager { |
| 27 public: | 28 public: |
| 28 // This is used to track which attributes a particular program needs | 29 // This is used to track which attributes a particular program needs |
| 29 // so we can verify at glDrawXXX time that every attribute is either disabled | 30 // so we can verify at glDrawXXX time that every attribute is either disabled |
| 30 // or if enabled that it points to a valid source. | 31 // or if enabled that it points to a valid source. |
| 31 class ProgramInfo : public base::RefCounted<ProgramInfo> { | 32 class GPU_EXPORT ProgramInfo : public base::RefCounted<ProgramInfo> { |
| 32 public: | 33 public: |
| 33 typedef scoped_refptr<ProgramInfo> Ref; | 34 typedef scoped_refptr<ProgramInfo> Ref; |
| 34 | 35 |
| 35 static const int kMaxAttachedShaders = 2; | 36 static const int kMaxAttachedShaders = 2; |
| 36 | 37 |
| 37 struct UniformInfo { | 38 struct UniformInfo { |
| 38 UniformInfo( | 39 UniformInfo( |
| 39 GLsizei _size, GLenum _type, GLint _fake_location_base, | 40 GLsizei _size, GLenum _type, GLint _fake_location_base, |
| 40 const std::string& _name); | 41 const std::string& _name); |
| 41 ~UniformInfo(); | 42 ~UniformInfo(); |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 void RemoveProgramInfoIfUnused( | 294 void RemoveProgramInfoIfUnused( |
| 294 ShaderManager* shader_manager, ProgramInfo* info); | 295 ShaderManager* shader_manager, ProgramInfo* info); |
| 295 | 296 |
| 296 DISALLOW_COPY_AND_ASSIGN(ProgramManager); | 297 DISALLOW_COPY_AND_ASSIGN(ProgramManager); |
| 297 }; | 298 }; |
| 298 | 299 |
| 299 } // namespace gles2 | 300 } // namespace gles2 |
| 300 } // namespace gpu | 301 } // namespace gpu |
| 301 | 302 |
| 302 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ | 303 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ |
| OLD | NEW |