| 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..337c2c091d2739cbe02a126da67198739334704d 100644
|
| --- a/gpu/command_buffer/service/program_manager.h
|
| +++ b/gpu/command_buffer/service/program_manager.h
|
| @@ -11,13 +11,16 @@
|
| #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 "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/program_cache.h"
|
| #include "gpu/command_buffer/service/shader_manager.h"
|
| #include "gpu/gpu_export.h"
|
|
|
| namespace gpu {
|
| +
|
| namespace gles2 {
|
|
|
| // Tracks the Programs.
|
| @@ -148,7 +151,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();
|
| @@ -289,7 +295,7 @@ class GPU_EXPORT ProgramManager {
|
| std::map<std::string, GLint> bind_attrib_location_map_;
|
| };
|
|
|
| - ProgramManager();
|
| + explicit ProgramManager(base::WeakPtr<ProgramCache> program_cache);
|
| ~ProgramManager();
|
|
|
| // Must call before destruction.
|
| @@ -304,6 +310,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* GetProgramCache() 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 +334,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* feature_info);
|
| +
|
| private:
|
| void StartTracking(ProgramInfo* info);
|
| void StopTracking(ProgramInfo* info);
|
| @@ -347,6 +360,8 @@ class GPU_EXPORT ProgramManager {
|
| // Used to clear uniforms.
|
| std::vector<uint8> zero_;
|
|
|
| + base::WeakPtr<ProgramCache> program_cache_;
|
| +
|
| void RemoveProgramInfoIfUnused(
|
| ShaderManager* shader_manager, ProgramInfo* info);
|
|
|
|
|