Index: src/gpu/gl/GrGLShaderBuilder.h |
diff --git a/src/gpu/gl/GrGLShaderBuilder.h b/src/gpu/gl/GrGLShaderBuilder.h |
index 52c24ae3acc0dfa931479d96b72735e01ebda019..103efa5aabcbde7e8d6a87ee9be5820a0ea76ce5 100644 |
--- a/src/gpu/gl/GrGLShaderBuilder.h |
+++ b/src/gpu/gl/GrGLShaderBuilder.h |
@@ -208,6 +208,25 @@ public: |
const GrGLContextInfo& ctxInfo() const; |
+ /** |
+ * Helper for begining and ending a block in the fragment code. TODO: Make GrGLShaderBuilder |
+ * aware of all blocks and turn single \t's into the correct number of tabs (or spaces) so that |
+ * our shaders print pretty without effect writers tracking indentation. |
+ */ |
+ class FSBlock { |
+ public: |
+ FSBlock(GrGLShaderBuilder* builder) : fBuilder(builder) { |
+ SkASSERT(NULL != builder); |
+ fBuilder->fsCodeAppend("\t{\n"); |
+ } |
+ |
+ ~FSBlock() { |
+ fBuilder->fsCodeAppend("\t}\n"); |
+ } |
+ private: |
+ GrGLShaderBuilder* fBuilder; |
+ }; |
+ |
protected: |
GrGpuGL* gpu() const { return fGpu; } |