OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/command_buffer/service/shader_translator.h" | 5 #include "gpu/command_buffer/service/shader_translator.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 int info_log_len = 0; | 129 int info_log_len = 0; |
130 ShGetInfo(compiler_, SH_INFO_LOG_LENGTH, &info_log_len); | 130 ShGetInfo(compiler_, SH_INFO_LOG_LENGTH, &info_log_len); |
131 if (info_log_len > 1) { | 131 if (info_log_len > 1) { |
132 info_log_.reset(new char[info_log_len]); | 132 info_log_.reset(new char[info_log_len]); |
133 ShGetInfoLog(compiler_, info_log_.get()); | 133 ShGetInfoLog(compiler_, info_log_.get()); |
134 } | 134 } |
135 | 135 |
136 return success; | 136 return success; |
137 } | 137 } |
138 | 138 |
| 139 const char* ShaderTranslator::translated_shader() const { |
| 140 return translated_shader_.get(); |
| 141 } |
| 142 |
| 143 const char* ShaderTranslator::info_log() const { |
| 144 return info_log_.get(); |
| 145 } |
| 146 |
| 147 const ShaderTranslatorInterface::VariableMap& |
| 148 ShaderTranslator::attrib_map() const { |
| 149 return attrib_map_; |
| 150 } |
| 151 |
| 152 const ShaderTranslatorInterface::VariableMap& |
| 153 ShaderTranslator::uniform_map() const { |
| 154 return uniform_map_; |
| 155 } |
| 156 |
139 void ShaderTranslator::ClearResults() { | 157 void ShaderTranslator::ClearResults() { |
140 translated_shader_.reset(); | 158 translated_shader_.reset(); |
141 info_log_.reset(); | 159 info_log_.reset(); |
142 attrib_map_.clear(); | 160 attrib_map_.clear(); |
143 uniform_map_.clear(); | 161 uniform_map_.clear(); |
144 } | 162 } |
145 | 163 |
146 } // namespace gles2 | 164 } // namespace gles2 |
147 } // namespace gpu | 165 } // namespace gpu |
148 | 166 |
OLD | NEW |