Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: gpu/command_buffer/service/shader_translator.h

Issue 10694111: RefCounted types should not have public destructors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android & Win compiles Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/sync_point_manager.cc ('k') | gpu/command_buffer/service/shader_translator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « content/common/gpu/sync_point_manager.cc ('k') | gpu/command_buffer/service/shader_translator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698