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 553c31335115049ea9257d812e813b6876f79b7b..3a3bf35f28780e0596c3a5bf3e5e8d076612be3b 100644 |
| --- a/gpu/command_buffer/service/program_manager.h |
| +++ b/gpu/command_buffer/service/program_manager.h |
| @@ -11,13 +11,17 @@ |
| #include "base/basictypes.h" |
| #include "base/logging.h" |
| #include "base/memory/ref_counted.h" |
| -#include "base/memory/scoped_ptr.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "base/file_path.h" |
|
greggman
2012/06/15 08:10:24
do you need file_path.h?
dmurph
2012/06/19 01:08:33
Done.
|
| #include "gpu/command_buffer/service/common_decoder.h" |
| +#include "gpu/command_buffer/service/feature_info.h" |
| #include "gpu/command_buffer/service/gl_utils.h" |
| +#include "gpu/command_buffer/service/shader_cache.h" |
| #include "gpu/command_buffer/service/shader_manager.h" |
| #include "gpu/gpu_export.h" |
| namespace gpu { |
| + |
| namespace gles2 { |
| // Tracks the Programs. |
| @@ -148,7 +152,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::Ref feature_info); |
| // Performs glValidateProgram and related activities. |
| void Validate(); |
| @@ -289,7 +296,7 @@ class GPU_EXPORT ProgramManager { |
| std::map<std::string, GLint> bind_attrib_location_map_; |
| }; |
| - ProgramManager(); |
| + explicit ProgramManager(base::WeakPtr<ShaderCache> shader_cache); |
| ~ProgramManager(); |
| // Must call before destruction. |
| @@ -304,6 +311,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 |
| + ShaderCache* GetShaderCache() const; |
| + |
| // Marks a program as deleted. If it is not used the info will be deleted. |
| void MarkAsDeleted(ShaderManager* shader_manager, ProgramInfo* info); |
| @@ -325,6 +335,10 @@ class GPU_EXPORT ProgramManager { |
| GLint SwizzleLocation(GLint unswizzled_location) const; |
| GLint UnswizzleLocation(GLint swizzled_location) const; |
| + void DoCompileShader(ShaderManager::ShaderInfo* info, |
| + ShaderTranslator* translator, |
| + FeatureInfo::Ref feature_info); |
| + |
| private: |
| void StartTracking(ProgramInfo* info); |
| void StopTracking(ProgramInfo* info); |
| @@ -347,6 +361,8 @@ class GPU_EXPORT ProgramManager { |
| // Used to clear uniforms. |
| std::vector<uint8> zero_; |
| + base::WeakPtr<ShaderCache> shader_cache_; |
| + |
| void RemoveProgramInfoIfUnused( |
| ShaderManager* shader_manager, ProgramInfo* info); |