aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLHCodeGenerator.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2018-04-24 13:06:09 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-25 16:53:27 +0000
commit3c6ae62e0f9faeab0242fca2d19d61e64a7c8a6e (patch)
tree68e1ebf040d2027349fc702ab7bf384d88a79ea3 /src/sksl/SkSLHCodeGenerator.cpp
parentf8f1839cc8ab08657ab4c6419726af3d20da4666 (diff)
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>
Diffstat (limited to 'src/sksl/SkSLHCodeGenerator.cpp')
-rw-r--r--src/sksl/SkSLHCodeGenerator.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sksl/SkSLHCodeGenerator.cpp b/src/sksl/SkSLHCodeGenerator.cpp
index 8984bde8d2..2c406aad8d 100644
--- a/src/sksl/SkSLHCodeGenerator.cpp
+++ b/src/sksl/SkSLHCodeGenerator.cpp
@@ -283,9 +283,9 @@ bool HCodeGenerator::generateCode() {
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);