cache SkSL headers
This reduces the cost of successive shader compilations by caching the
results of compiling SkSL's headers.
Bug: skia:
Change-Id: If7fc21a9877021c4025ad99dd0981523a25855e0
Reviewed-on: https://skia-review.googlesource.com/123422
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/sksl/SkSLHCodeGenerator.cpp b/src/sksl/SkSLHCodeGenerator.cpp
index 8984bde..2c406aa 100644
--- a/src/sksl/SkSLHCodeGenerator.cpp
+++ b/src/sksl/SkSLHCodeGenerator.cpp
@@ -283,9 +283,9 @@
this->writef("class %s : public GrFragmentProcessor {\n"
"public:\n",
fFullName.c_str());
- for (const auto& p : fProgram.fElements) {
- if (ProgramElement::kEnum_Kind == p->fKind && !((Enum&) *p).fBuiltin) {
- this->writef("%s\n", p->description().c_str());
+ for (const auto& p : fProgram) {
+ if (ProgramElement::kEnum_Kind == p.fKind && !((Enum&) p).fBuiltin) {
+ this->writef("%s\n", p.description().c_str());
}
}
this->writeSection(CLASS_SECTION);