Add program-settings flag to disable the inliner.

Change-Id: I6c4e7f6a2aab6710221029022a3a5f3ec323c5e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317856
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
diff --git a/src/sksl/SkSLCompiler.cpp b/src/sksl/SkSLCompiler.cpp
index 4497b9b..db5dc3e 100644
--- a/src/sksl/SkSLCompiler.cpp
+++ b/src/sksl/SkSLCompiler.cpp
@@ -351,16 +351,14 @@
         fIRGenerator->fSymbolTable = std::move(base);
     }
     Program::Settings settings;
+    settings.fInline = false;
 #if !defined(SKSL_STANDALONE) & SK_SUPPORT_GPU
     GrContextOptions opts;
     GrShaderCaps caps(opts);
     settings.fCaps = &caps;
 #endif
-    SkASSERT(fIRGenerator->fCanInline);
-    fIRGenerator->fCanInline = false;
     fIRGenerator->start(&settings, nullptr, true);
     fIRGenerator->convertProgram(kind, source->c_str(), source->length(), outElements);
-    fIRGenerator->fCanInline = true;
     if (this->fErrorCount) {
         printf("Unexpected errors: %s\n", this->fErrorText.c_str());
     }
@@ -1683,7 +1681,9 @@
         }
 
         // Perform inline-candidate analysis and inline any functions deemed suitable.
-        madeChanges |= fInliner.analyze(program);
+        if (program.fSettings.fInline) {
+            madeChanges |= fInliner.analyze(program);
+        }
 
         // Remove dead functions. We wait until after analysis so that we still report errors,
         // even in unused code.