summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/shader_translator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gpu/command_buffer/service/shader_translator.cc')
-rw-r--r--gpu/command_buffer/service/shader_translator.cc23
1 files changed, 13 insertions, 10 deletions
diff --git a/gpu/command_buffer/service/shader_translator.cc b/gpu/command_buffer/service/shader_translator.cc
index 6839736..c58d198 100644
--- a/gpu/command_buffer/service/shader_translator.cc
+++ b/gpu/command_buffer/service/shader_translator.cc
@@ -11,6 +11,9 @@
#include "base/logging.h"
namespace {
+
+using gpu::gles2::ShaderTranslator;
+
void FinalizeShaderTranslator(void* /* dummy */) {
ShFinalize();
}
@@ -24,7 +27,6 @@ bool InitializeShaderTranslator() {
return initialized;
}
-using gpu::gles2::ShaderTranslator;
void GetVariableInfo(ShHandle compiler, ShShaderInfo var_type,
ShaderTranslator::VariableMap* var_map) {
int name_len = 0, mapped_name_len = 0;
@@ -72,6 +74,7 @@ void GetVariableInfo(ShHandle compiler, ShShaderInfo var_type,
(*var_map)[mapped_name.get()] = info;
}
}
+
} // namespace
namespace gpu {
@@ -89,15 +92,6 @@ ShaderTranslator::ShaderTranslator()
needs_built_in_function_emulation_(false) {
}
-ShaderTranslator::~ShaderTranslator() {
- FOR_EACH_OBSERVER(DestructionObserver,
- destruction_observers_,
- OnDestruct(this));
-
- if (compiler_ != NULL)
- ShDestruct(compiler_);
-}
-
bool ShaderTranslator::Init(
ShShaderType shader_type,
ShShaderSpec shader_spec,
@@ -191,6 +185,15 @@ void ShaderTranslator::RemoveDestructionObserver(
destruction_observers_.RemoveObserver(observer);
}
+ShaderTranslator::~ShaderTranslator() {
+ FOR_EACH_OBSERVER(DestructionObserver,
+ destruction_observers_,
+ OnDestruct(this));
+
+ if (compiler_ != NULL)
+ ShDestruct(compiler_);
+}
+
void ShaderTranslator::ClearResults() {
translated_shader_.reset();
info_log_.reset();