aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLGLSLCodeGenerator.h
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2018-07-27 10:03:46 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-27 17:23:46 +0000
commit88f6d37f3fd98eb7a588c2188f25cf8de42b41a6 (patch)
tree82f1e5972733d55f855628e522d59ee996a53d53 /src/sksl/SkSLGLSLCodeGenerator.h
parent55e553525d0cf90c261f841c561be50eb7814fd7 (diff)
Fixed GLSL header line ordering
Under some circumstances, an extension could be written after a global variable. This should fix the ordering so that can never happen again. Bug: b/111582212 Change-Id: Id2f7645253fdc521ba85ca0e6863236baef63a4b Reviewed-on: https://skia-review.googlesource.com/143102 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/SkSLGLSLCodeGenerator.h')
-rw-r--r--src/sksl/SkSLGLSLCodeGenerator.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sksl/SkSLGLSLCodeGenerator.h b/src/sksl/SkSLGLSLCodeGenerator.h
index 362ae7ca18..e19444d74d 100644
--- a/src/sksl/SkSLGLSLCodeGenerator.h
+++ b/src/sksl/SkSLGLSLCodeGenerator.h
@@ -102,7 +102,9 @@ protected:
void writeType(const Type& type);
- void writeExtension(const Extension& ext);
+ void writeExtension(const String& name);
+
+ void writeExtension(const String& name, bool require);
void writeInterfaceBlock(const InterfaceBlock& intf);
@@ -194,7 +196,8 @@ protected:
const char* fLineEnding;
const Context& fContext;
- StringStream fHeader;
+ StringStream fExtensions;
+ StringStream fGlobals;
StringStream fExtraFunctions;
String fFunctionHeader;
Program::Kind fProgramKind;