| Index: gpu/command_buffer/service/shader_manager.h
|
| diff --git a/gpu/command_buffer/service/shader_manager.h b/gpu/command_buffer/service/shader_manager.h
|
| index 1324238f2a9c2c2d8047b3602dbff6f63f196abe..359e574337d2d5fda3b80826dcc185674acff32c 100644
|
| --- a/gpu/command_buffer/service/shader_manager.h
|
| +++ b/gpu/command_buffer/service/shader_manager.h
|
| @@ -24,16 +24,15 @@ namespace gles2 {
|
| // should get the source they passed in, not the re-written source.
|
| class GPU_EXPORT Shader : public base::RefCounted<Shader> {
|
| public:
|
| + enum TranslatedShaderSourceType {
|
| + kANGLE,
|
| + kGL, // GL or GLES
|
| + };
|
| +
|
| typedef ShaderTranslator::VariableInfo VariableInfo;
|
|
|
| - void UpdateSource(const char* source) {
|
| - source_.reset(source ? new std::string(source) : NULL);
|
| - }
|
| -
|
| - void UpdateTranslatedSource(const char* translated_source) {
|
| - translated_source_.reset(
|
| - translated_source ? new std::string(translated_source) : NULL);
|
| - }
|
| + void DoCompile(ShaderTranslatorInterface* translator,
|
| + TranslatedShaderSourceType type);
|
|
|
| GLuint service_id() const {
|
| return service_id_;
|
| @@ -43,24 +42,25 @@ class GPU_EXPORT Shader : public base::RefCounted<Shader> {
|
| return shader_type_;
|
| }
|
|
|
| - const std::string* source() const {
|
| - return source_.get();
|
| + const std::string& source() const {
|
| + return source_;
|
| }
|
|
|
| - const std::string* translated_source() const {
|
| - return translated_source_.get();
|
| + void set_source(const std::string& source) {
|
| + source_ = source;
|
| }
|
|
|
| - const std::string* signature_source() const {
|
| - return signature_source_.get();
|
| + const std::string& translated_source() const {
|
| + return translated_source_;
|
| }
|
|
|
| - void SetStatus(
|
| - bool valid, const char* log,
|
| - ShaderTranslatorInterface* translator);
|
| + const std::string& signature_source() const {
|
| + return signature_source_;
|
| + }
|
|
|
| const VariableInfo* GetAttribInfo(const std::string& name) const;
|
| const VariableInfo* GetUniformInfo(const std::string& name) const;
|
| + const VariableInfo* GetVaryingInfo(const std::string& name) const;
|
|
|
| // If the original_name is not found, return NULL.
|
| const std::string* GetAttribMappedName(
|
| @@ -70,11 +70,11 @@ class GPU_EXPORT Shader : public base::RefCounted<Shader> {
|
| const std::string* GetOriginalNameFromHashedName(
|
| const std::string& hashed_name) const;
|
|
|
| - const std::string* log_info() const {
|
| - return log_info_.get();
|
| + const std::string& log_info() const {
|
| + return log_info_;
|
| }
|
|
|
| - bool IsValid() const {
|
| + bool valid() const {
|
| return valid_;
|
| }
|
|
|
| @@ -145,16 +145,16 @@ class GPU_EXPORT Shader : public base::RefCounted<Shader> {
|
| bool valid_;
|
|
|
| // The shader source as passed to glShaderSource.
|
| - scoped_ptr<std::string> source_;
|
| + std::string source_;
|
|
|
| // The source the last compile used.
|
| - scoped_ptr<std::string> signature_source_;
|
| + std::string signature_source_;
|
|
|
| // The translated shader source.
|
| - scoped_ptr<std::string> translated_source_;
|
| + std::string translated_source_;
|
|
|
| // The shader translation log.
|
| - scoped_ptr<std::string> log_info_;
|
| + std::string log_info_;
|
|
|
| // The type info when the shader was last compiled.
|
| VariableMap attrib_map_;
|
|
|