Add option for fuzzer to toggle DAA

Of note, this is a breaking change to the fuzzed format
for any canvas fuzzers.  I've updated the seed corpora to match
but any repro cases predating this will need to have the a single
byte added to the front of the test case:

echo -n -e '\x00' | cat - file > outputfile


Bug: 847386
Change-Id: I10b3b228e9c121340857fb8e7807464e54e9238a
Reviewed-on: https://skia-review.googlesource.com/131522
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
This commit is contained in:
Kevin Lubick 2018-06-01 13:16:20 -04:00
parent f14bc98b2f
commit d2ae8dcce3

View File

@ -1077,11 +1077,20 @@ static sk_sp<SkTextBlob> make_fuzz_textblob(Fuzz* fuzz) {
return textBlobBuilder.make();
}
extern std::atomic<bool> gSkUseDeltaAA;
extern std::atomic<bool> gSkForceDeltaAA;
static void fuzz_canvas(Fuzz* fuzz, SkCanvas* canvas, int depth = 9) {
if (!fuzz || !canvas || depth <= 0) {
return;
}
SkAutoCanvasRestore autoCanvasRestore(canvas, false);
bool useDAA;
fuzz->next(&useDAA);
if (useDAA) {
gSkForceDeltaAA = true;
gSkUseDeltaAA = true;
}
unsigned N;
fuzz->nextRange(&N, 0, 2000);
for (unsigned i = 0; i < N; ++i) {