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

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

Issue 566023002: Clean up interfaces between Shader / ShaderTranslator / ANGLE side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
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_;
« no previous file with comments | « gpu/command_buffer/service/program_manager_unittest.cc ('k') | gpu/command_buffer/service/shader_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698