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

Unified Diff: src/gpu/glsl/GrGLSL.h

Issue 1881513002: Add appendPrecisionModifier method to GrGLSLShaderBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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/effects/GrTextureDomain.cpp ('k') | src/gpu/glsl/GrGLSLShaderBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSL.h
diff --git a/src/gpu/glsl/GrGLSL.h b/src/gpu/glsl/GrGLSL.h
index 12c1f1fcc6b375e35a677757f28adf76d0a4662a..9f5f2b05b4178744087a1bb51d3a161d2c7889be 100644
--- a/src/gpu/glsl/GrGLSL.h
+++ b/src/gpu/glsl/GrGLSL.h
@@ -84,6 +84,23 @@ void GrGLSLAppendDefaultFloatPrecisionDeclaration(GrSLPrecision,
SkString* out);
/**
+ * Converts a GrSLPrecision to its corresponding GLSL precision qualifier.
+ */
+static inline const char* GrGLSLPrecisionString(GrSLPrecision p) {
+ switch (p) {
+ case kLow_GrSLPrecision:
+ return "lowp";
+ case kMedium_GrSLPrecision:
+ return "mediump";
+ case kHigh_GrSLPrecision:
+ return "highp";
+ default:
+ SkFAIL("Unexpected precision type.");
+ return "";
+ }
+}
+
+/**
* Converts a GrSLType to a string containing the name of the equivalent GLSL type.
*/
static inline const char* GrGLSLTypeString(GrSLType t) {
« no previous file with comments | « src/gpu/effects/GrTextureDomain.cpp ('k') | src/gpu/glsl/GrGLSLShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698