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

Unified Diff: src/gpu/gl/GrGLShaderVar.h

Issue 13895006: Expand modulate, add, subtract, extract component glsl helpers. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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 | « src/gpu/gl/GrGLShaderBuilder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLShaderVar.h
===================================================================
--- src/gpu/gl/GrGLShaderVar.h (revision 8735)
+++ src/gpu/gl/GrGLShaderVar.h (working copy)
@@ -268,46 +268,22 @@
if (this->isArray()) {
if (this->isUnsizedArray()) {
out->appendf("%s %s[]",
- TypeString(effectiveType),
+ GrGLSLTypeString(effectiveType),
this->getName().c_str());
} else {
GrAssert(this->getArrayCount() > 0);
out->appendf("%s %s[%d]",
- TypeString(effectiveType),
+ GrGLSLTypeString(effectiveType),
this->getName().c_str(),
this->getArrayCount());
}
} else {
out->appendf("%s %s",
- TypeString(effectiveType),
+ GrGLSLTypeString(effectiveType),
this->getName().c_str());
}
}
- static const char* TypeString(GrSLType t) {
- switch (t) {
- case kVoid_GrSLType:
- return "void";
- case kFloat_GrSLType:
- return "float";
- case kVec2f_GrSLType:
- return "vec2";
- case kVec3f_GrSLType:
- return "vec3";
- case kVec4f_GrSLType:
- return "vec4";
- case kMat33f_GrSLType:
- return "mat3";
- case kMat44f_GrSLType:
- return "mat4";
- case kSampler2D_GrSLType:
- return "sampler2D";
- default:
- GrCrash("Unknown shader var type.");
- return ""; // suppress warning
- }
- }
-
void appendArrayAccess(int index, SkString* out) const {
out->appendf("%s[%d]%s",
this->getName().c_str(),
« no previous file with comments | « src/gpu/gl/GrGLShaderBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698