diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2016-11-11 12:38:50 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-11 18:21:14 +0000 |
commit | 498d403f7703cb2157bf3c877b84906db5a06cd4 (patch) | |
tree | 88d7c27bbaee6d9b9614e29f9363b15543b7860c /fuzz/fuzz.cpp | |
parent | 041da389dd923689041ba5e45cda34901ba4fe8a (diff) |
re-land of skslc now uses standard Skia caps
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4726
Change-Id: Ib1ea5d4269396e6c57ee1f0d7209aa9a9f2798e8
Reviewed-on: https://skia-review.googlesource.com/4726
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'fuzz/fuzz.cpp')
-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) {} |