| Index: gpu/command_buffer/service/program_manager.h
|
| ===================================================================
|
| --- gpu/command_buffer/service/program_manager.h (revision 147496)
|
| +++ gpu/command_buffer/service/program_manager.h (working copy)
|
| @@ -11,6 +11,7 @@
|
| #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/gl_utils.h"
|
| #include "gpu/command_buffer/service/shader_manager.h"
|
| @@ -18,8 +19,6 @@
|
|
|
| namespace gpu {
|
| namespace gles2 {
|
| -class ProgramCache;
|
| -class FeatureInfo;
|
|
|
| // Tracks the Programs.
|
| //
|
| @@ -27,8 +26,6 @@
|
| // need to be shared by multiple GLES2Decoders.
|
| class GPU_EXPORT ProgramManager {
|
| public:
|
| - typedef std::map<std::string, GLint> LocationMap;
|
| -
|
| // This is used to track which attributes a particular program needs
|
| // so we can verify at glDrawXXX time that every attribute is either disabled
|
| // or if enabled that it points to a valid source.
|
| @@ -153,10 +150,7 @@
|
| bool CanLink() const;
|
|
|
| // Performs glLinkProgram and related activities.
|
| - bool Link(ShaderManager* manager,
|
| - ShaderTranslator* vertex_translator,
|
| - ShaderTranslator* fragment_shader,
|
| - FeatureInfo* feature_info);
|
| + bool Link();
|
|
|
| // Performs glValidateProgram and related activities.
|
| void Validate();
|
| @@ -184,15 +178,12 @@
|
| // We only consider the declared attributes in the program.
|
| bool DetectAttribLocationBindingConflicts() const;
|
|
|
| - // Visible for testing
|
| - const LocationMap& bind_attrib_location_map() const {
|
| - return bind_attrib_location_map_;
|
| - }
|
| -
|
| private:
|
| friend class base::RefCounted<ProgramInfo>;
|
| friend class ProgramManager;
|
|
|
| + typedef std::map<std::string, GLint> LocationMap;
|
| +
|
| ~ProgramInfo();
|
|
|
| void set_log_info(const char* str) {
|
| @@ -308,7 +299,7 @@
|
| LocationMap bind_uniform_location_map_;
|
| };
|
|
|
| - explicit ProgramManager(ProgramCache* program_cache);
|
| + ProgramManager();
|
| ~ProgramManager();
|
|
|
| // Must call before destruction.
|
| @@ -323,9 +314,6 @@
|
| // 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);
|
|
|
| @@ -346,19 +334,7 @@
|
|
|
| static int32 MakeFakeLocation(int32 index, int32 element);
|
|
|
| - // Cache-aware shader compiling. If no cache or if the shader wasn't
|
| - // previously compiled, ForceCompileShader is called
|
| - void DoCompileShader(ShaderManager::ShaderInfo* info,
|
| - ShaderTranslator* translator,
|
| - FeatureInfo* feature_info);
|
| -
|
| private:
|
| - // Actually compiles the shader
|
| - void ForceCompileShader(const std::string* source,
|
| - ShaderManager::ShaderInfo* info,
|
| - ShaderTranslator* translator,
|
| - FeatureInfo* feature_info);
|
| -
|
| void StartTracking(ProgramInfo* info);
|
| void StopTracking(ProgramInfo* info);
|
|
|
| @@ -378,8 +354,6 @@
|
| // Used to clear uniforms.
|
| std::vector<uint8> zero_;
|
|
|
| - ProgramCache* program_cache_;
|
| -
|
| void RemoveProgramInfoIfUnused(
|
| ShaderManager* shader_manager, ProgramInfo* info);
|
|
|
|
|