aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-04-06 10:37:55 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-06 18:27:53 +0000
commit3e8c3458f036da88eca1225a5c6a2cce228f894e (patch)
treeb910cd1a3a25994bbf7b52effde770fae7a2fb2f /src/sksl
parent4961a938586e3c46cf80f15ecb70a011324bfe59 (diff)
Make generated effects from sksl fp files not need SK_SUPPORT_GPU
Bug: skia: Change-Id: I42a5c7fe7dc35a23290c8daa754c9fcce07f76fb Reviewed-on: https://skia-review.googlesource.com/119010 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/sksl')
-rw-r--r--src/sksl/SkSLCPPCodeGenerator.cpp5
-rw-r--r--src/sksl/SkSLHCodeGenerator.cpp6
2 files changed, 4 insertions, 7 deletions
diff --git a/src/sksl/SkSLCPPCodeGenerator.cpp b/src/sksl/SkSLCPPCodeGenerator.cpp
index 7b35ca8f90..7b740a7a71 100644
--- a/src/sksl/SkSLCPPCodeGenerator.cpp
+++ b/src/sksl/SkSLCPPCodeGenerator.cpp
@@ -766,8 +766,7 @@ bool CPPCodeGenerator::generateCode() {
const char* fullName = fFullName.c_str();
this->writef("%s\n", HCodeGenerator::GetHeader(fProgram, fErrors).c_str());
this->writef(kFragmentProcessorHeader, fullName);
- this->writef("#include \"%s.h\"\n"
- "#if SK_SUPPORT_GPU\n", fullName);
+ this->writef("#include \"%s.h\"\n", fullName);
this->writeSection(CPP_SECTION);
this->writef("#include \"glsl/GrGLSLFragmentProcessor.h\"\n"
"#include \"glsl/GrGLSLFragmentShaderBuilder.h\"\n"
@@ -820,7 +819,7 @@ bool CPPCodeGenerator::generateCode() {
this->writeClone();
this->writeTest();
this->writeSection(CPP_END_SECTION);
- this->write("#endif\n");
+
result &= 0 == fErrors.errorCount();
return result;
}
diff --git a/src/sksl/SkSLHCodeGenerator.cpp b/src/sksl/SkSLHCodeGenerator.cpp
index ad97722077..8984bde8d2 100644
--- a/src/sksl/SkSLHCodeGenerator.cpp
+++ b/src/sksl/SkSLHCodeGenerator.cpp
@@ -276,8 +276,7 @@ bool HCodeGenerator::generateCode() {
"#define %s_DEFINED\n",
fFullName.c_str(),
fFullName.c_str());
- this->writef("#include \"SkTypes.h\"\n"
- "#if SK_SUPPORT_GPU\n");
+ this->writef("#include \"SkTypes.h\"\n");
this->writeSection(HEADER_SECTION);
this->writef("#include \"GrFragmentProcessor.h\"\n"
"#include \"GrCoordTransform.h\"\n");
@@ -317,8 +316,7 @@ bool HCodeGenerator::generateCode() {
this->writef(" typedef GrFragmentProcessor INHERITED;\n"
"};\n");
this->writeSection(HEADER_END_SECTION);
- this->writef("#endif\n"
- "#endif\n");
+ this->writef("#endif\n");
return 0 == fErrors.errorCount();
}