aboutsummaryrefslogtreecommitdiffhomepage
path: root/fuzz
diff options
context:
space:
mode:
authorGravatar Kevin Lubick <kjlubick@google.com>2018-06-01 13:16:20 -0400
committerGravatar Kevin Lubick <kjlubick@google.com>2018-06-01 17:44:23 +0000
commitd2ae8dcce3a945567df408507a488fd29a539e3c (patch)
tree19473ab2a12ba15c514d3f6252867b3203e74c74 /fuzz
parentf14bc98b2f003bd273875da94016eaa690e6d9de (diff)
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>
Diffstat (limited to 'fuzz')
-rw-r--r--fuzz/FuzzCanvas.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/fuzz/FuzzCanvas.cpp b/fuzz/FuzzCanvas.cpp
index b843804460..8e84e88b3c 100644
--- a/fuzz/FuzzCanvas.cpp
+++ b/fuzz/FuzzCanvas.cpp
@@ -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) {