diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2016-11-21 10:39:35 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-21 17:14:43 +0000 |
commit | 9e1138d56665d13641f8805cd72ae81adc255f79 (patch) | |
tree | 1c94ded7cff10f5f62233d1de83c3d30ad0a2893 /src/sksl/SkSLGLSLCodeGenerator.h | |
parent | e54d4cefb7864a575c01894b2e5e0df16978c6e6 (diff) |
re-land of switched skslc from std::string to SkString
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5084
Change-Id: Ib21c30afc0d8483392b417e660b7fecfcc30e617
Reviewed-on: https://skia-review.googlesource.com/5084
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/SkSLGLSLCodeGenerator.h')
-rw-r--r-- | src/sksl/SkSLGLSLCodeGenerator.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/sksl/SkSLGLSLCodeGenerator.h b/src/sksl/SkSLGLSLCodeGenerator.h index 16d6192a71..b8cb34e84f 100644 --- a/src/sksl/SkSLGLSLCodeGenerator.h +++ b/src/sksl/SkSLGLSLCodeGenerator.h @@ -12,6 +12,7 @@ #include <tuple> #include <unordered_map> +#include "SkStream.h" #include "glsl/GrGLSLCaps.h" #include "SkSLCodeGenerator.h" #include "ir/SkSLBinaryExpression.h" @@ -75,7 +76,7 @@ public: : fContext(*context) , fCaps(*caps) {} - void generateCode(const Program& program, std::ostream& out) override; + void generateCode(const Program& program, SkWStream& out) override; private: void write(const char* s); @@ -84,9 +85,9 @@ private: void writeLine(const char* s); - void write(const std::string& s); + void write(const SkString& s); - void writeLine(const std::string& s); + void writeLine(const SkString& s); void writeType(const Type& type); @@ -156,9 +157,9 @@ private: const Context& fContext; const GrGLSLCaps& fCaps; - std::ostream* fOut = nullptr; - std::stringstream fHeader; - std::string fFunctionHeader; + SkWStream* fOut = nullptr; + SkDynamicMemoryWStream fHeader; + SkString fFunctionHeader; Program::Kind fProgramKind; int fVarCount = 0; int fIndentation = 0; |