diff options
author | 2016-11-11 15:16:46 -0500 | |
---|---|---|
committer | 2016-11-11 21:15:29 +0000 | |
commit | 7ef4b74e57a143e4e586e577e9b7c11c3aab472d (patch) | |
tree | 5ca0e9f4e9fc44806f0ef45eb70c0ff350cf13a0 /fuzz | |
parent | dca4f6530013cf43a2557ccb07f5cb4fd916b8e8 (diff) |
re-re-land of skslc now uses standard Skia caps
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4732
Change-Id: I144110bf66f67a28da7ad333173db43bddf9e8d0
Reviewed-on: https://skia-review.googlesource.com/4732
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'fuzz')
-rw-r--r-- | fuzz/fuzz.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fuzz/fuzz.cpp b/fuzz/fuzz.cpp index d6534f1aff..d146a2f519 100644 --- a/fuzz/fuzz.cpp +++ b/fuzz/fuzz.cpp @@ -16,7 +16,9 @@ #include "SkPicture.h" #include "SkPicture.h" #include "SkPicture.h" +#if SK_SUPPORT_GPU #include "SkSLCompiler.h" +#endif #include "SkStream.h" #include <signal.h> @@ -38,7 +40,9 @@ static int fuzz_img(sk_sp<SkData>, uint8_t, uint8_t); static int fuzz_skp(sk_sp<SkData>); static int fuzz_icc(sk_sp<SkData>); static int fuzz_color_deserialize(sk_sp<SkData>); +#if SK_SUPPORT_GPU static int fuzz_sksl2glsl(sk_sp<SkData>); +#endif int main(int argc, char** argv) { SkCommandLineFlags::Parse(argc, argv); @@ -71,9 +75,11 @@ int main(int argc, char** argv) { if (0 == strcmp("skp", FLAGS_type[0])) { return fuzz_skp(bytes); } +#if SK_SUPPORT_GPU if (0 == strcmp("sksl2glsl", FLAGS_type[0])) { return fuzz_sksl2glsl(bytes); } +#endif } return printUsage(argv[0]); } @@ -393,11 +399,12 @@ int fuzz_color_deserialize(sk_sp<SkData> bytes) { return 0; } +#if SK_SUPPORT_GPU int fuzz_sksl2glsl(sk_sp<SkData> bytes) { SkSL::Compiler compiler; std::string output; bool result = compiler.toGLSL(SkSL::Program::kFragment_Kind, - (const char*)bytes->data(), SkSL::GLCaps(), &output); + (const char*)bytes->data(), *SkSL::GLSLCapsFactory::Default(), &output); if (!result) { SkDebugf("[terminated] Couldn't compile input.\n"); @@ -406,6 +413,7 @@ int fuzz_sksl2glsl(sk_sp<SkData> bytes) { SkDebugf("[terminated] Success! Compiled input.\n"); return 0; } +#endif Fuzz::Fuzz(sk_sp<SkData> bytes) : fBytes(bytes), fNextByte(0) {} |