| Index: gpu/command_buffer/service/shader_translator.h
|
| diff --git a/gpu/command_buffer/service/shader_translator.h b/gpu/command_buffer/service/shader_translator.h
|
| index 9173740170de0c2abb4fbadd90f967c33dbb71b9..f82343e6657bb323f1565df9209b90c67f03dc19 100644
|
| --- a/gpu/command_buffer/service/shader_translator.h
|
| +++ b/gpu/command_buffer/service/shader_translator.h
|
| @@ -32,7 +32,25 @@ class ShaderTranslatorInterface {
|
| kGlslBuiltInFunctionEmulated
|
| };
|
|
|
| - virtual ~ShaderTranslatorInterface() { }
|
| + struct VariableInfo {
|
| + VariableInfo()
|
| + : type(0),
|
| + size(0) {
|
| + }
|
| +
|
| + VariableInfo(int _type, int _size, std::string _name)
|
| + : type(_type),
|
| + size(_size),
|
| + name(_name) {
|
| + }
|
| +
|
| + int type;
|
| + int size;
|
| + std::string name; // name in the original shader source.
|
| + };
|
| +
|
| + // Mapping between variable name and info.
|
| + typedef base::hash_map<std::string, VariableInfo> VariableMap;
|
|
|
| // Initializes the translator.
|
| // Must be called once before using the translator object.
|
| @@ -54,24 +72,11 @@ class ShaderTranslatorInterface {
|
| virtual const char* translated_shader() const = 0;
|
| virtual const char* info_log() const = 0;
|
|
|
| - struct VariableInfo {
|
| - VariableInfo()
|
| - : type(0),
|
| - size(0) {
|
| - }
|
| - VariableInfo(int _type, int _size, std::string _name)
|
| - : type(_type),
|
| - size(_size),
|
| - name(_name) {
|
| - }
|
| - int type;
|
| - int size;
|
| - std::string name; // name in the original shader source.
|
| - };
|
| - // Mapping between variable name and info.
|
| - typedef base::hash_map<std::string, VariableInfo> VariableMap;
|
| virtual const VariableMap& attrib_map() const = 0;
|
| virtual const VariableMap& uniform_map() const = 0;
|
| +
|
| + protected:
|
| + virtual ~ShaderTranslatorInterface() {}
|
| };
|
|
|
| // Implementation of ShaderTranslatorInterface
|
| @@ -85,6 +90,7 @@ class GPU_EXPORT ShaderTranslator
|
| virtual ~DestructionObserver();
|
|
|
| virtual void OnDestruct(ShaderTranslator* translator) = 0;
|
| +
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(DestructionObserver);
|
| };
|
| @@ -114,8 +120,9 @@ class GPU_EXPORT ShaderTranslator
|
| void RemoveDestructionObserver(DestructionObserver* observer);
|
|
|
| private:
|
| - virtual ~ShaderTranslator();
|
| + friend class base::RefCounted<ShaderTranslator>;
|
|
|
| + virtual ~ShaderTranslator();
|
| void ClearResults();
|
|
|
| ShHandle compiler_;
|
| @@ -127,8 +134,6 @@ class GPU_EXPORT ShaderTranslator
|
| bool needs_built_in_function_emulation_;
|
| ObserverList<DestructionObserver> destruction_observers_;
|
|
|
| - friend class base::RefCounted<ShaderTranslator>;
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(ShaderTranslator);
|
| };
|
|
|
|
|