Chromium Code Reviews| Index: gpu/command_buffer/service/program_manager.h |
| diff --git a/gpu/command_buffer/service/program_manager.h b/gpu/command_buffer/service/program_manager.h |
| index d2655cc97ae2345e5806984389c24af88d1d96c4..4d647a54a6dd31d3642a0917af72eb70376b3c58 100644 |
| --- a/gpu/command_buffer/service/program_manager.h |
| +++ b/gpu/command_buffer/service/program_manager.h |
| @@ -11,9 +11,10 @@ |
| #include "base/basictypes.h" |
| #include "base/logging.h" |
| #include "base/memory/ref_counted.h" |
| -#include "base/memory/scoped_ptr.h" |
| #include "gpu/command_buffer/service/common_decoder.h" |
| +#include "gpu/command_buffer/service/feature_info.h" |
|
greggman
2012/06/26 23:00:27
forward declare instead?
dmurph
2012/07/04 00:01:29
Done.
|
| #include "gpu/command_buffer/service/gl_utils.h" |
| +#include "gpu/command_buffer/service/program_cache.h" |
|
greggman
2012/06/26 23:00:27
forward declare instead?
dmurph
2012/07/04 00:01:29
Done.
|
| #include "gpu/command_buffer/service/shader_manager.h" |
| #include "gpu/gpu_export.h" |
| @@ -148,7 +149,10 @@ class GPU_EXPORT ProgramManager { |
| bool CanLink() const; |
| // Performs glLinkProgram and related activities. |
| - bool Link(); |
| + bool Link(ShaderManager* manager, |
| + ShaderTranslator* vertex_translator, |
| + ShaderTranslator* fragment_shader, |
| + FeatureInfo* feature_info); |
| // Performs glValidateProgram and related activities. |
| void Validate(); |
| @@ -284,7 +288,7 @@ class GPU_EXPORT ProgramManager { |
| std::map<std::string, GLint> bind_attrib_location_map_; |
| }; |
| - ProgramManager(); |
| + explicit ProgramManager(ProgramCache* program_cache); |
| ~ProgramManager(); |
| // Must call before destruction. |
| @@ -299,6 +303,9 @@ class GPU_EXPORT ProgramManager { |
| // Gets a client id for a given service id. |
| bool GetClientId(GLuint service_id, GLuint* client_id) const; |
| + // Gets the shader cache |
| + ProgramCache* program_cache() const; |
| + |
| // Marks a program as deleted. If it is not used the info will be deleted. |
| void MarkAsDeleted(ShaderManager* shader_manager, ProgramInfo* info); |
| @@ -317,6 +324,13 @@ class GPU_EXPORT ProgramManager { |
| // Check if a ProgramInfo is owned by this ProgramManager. |
| bool IsOwned(ProgramInfo* info); |
| + GLint SwizzleLocation(GLint unswizzled_location) const; |
|
greggman
2012/06/26 23:00:27
These changed. You probably need to rebase.
dmurph
2012/07/04 00:01:29
Done.
|
| + GLint UnswizzleLocation(GLint swizzled_location) const; |
| + |
| + void DoCompileShader(ShaderManager::ShaderInfo* info, |
| + ShaderTranslator* translator, |
| + FeatureInfo* feature_info); |
| + |
| private: |
| void StartTracking(ProgramInfo* info); |
| void StopTracking(ProgramInfo* info); |
| @@ -337,6 +351,8 @@ class GPU_EXPORT ProgramManager { |
| // Used to clear uniforms. |
| std::vector<uint8> zero_; |
| + ProgramCache* program_cache_; |
| + |
| void RemoveProgramInfoIfUnused( |
| ShaderManager* shader_manager, ProgramInfo* info); |