From 3e8c3458f036da88eca1225a5c6a2cce228f894e Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Fri, 6 Apr 2018 10:37:55 -0400 Subject: 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 Reviewed-by: Robert Phillips --- src/sksl/SkSLCPPCodeGenerator.cpp | 5 ++--- src/sksl/SkSLHCodeGenerator.cpp | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'src/sksl') 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(); } -- cgit v1.2.3