From 85d301745a9031b13f1b716f07e1041f2fdd1ce3 Mon Sep 17 00:00:00 2001 From: kjlubick Date: Mon, 24 Oct 2016 11:53:35 -0700 Subject: Fix fuzzer's bools to be 0 or 1 only BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2447823002 Review-Url: https://codereview.chromium.org/2447823002 --- fuzz/FuzzGradients.cpp | 70 +++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'fuzz/FuzzGradients.cpp') diff --git a/fuzz/FuzzGradients.cpp b/fuzz/FuzzGradients.cpp index d24bdbe057..2478bca283 100644 --- a/fuzz/FuzzGradients.cpp +++ b/fuzz/FuzzGradients.cpp @@ -17,15 +17,15 @@ const int MAX_COUNT = 400; bool makeMatrix(Fuzz* fuzz, SkMatrix* m) { SkScalar scaleX, skewX, transX, skewY, scaleY, transY, persp0, persp1, persp2; - if (!fuzz->next(&scaleX) || - !fuzz->next(&skewX) || - !fuzz->next(&transX) || - !fuzz->next(&skewY) || - !fuzz->next(&scaleY) || - !fuzz->next(&transY) || - !fuzz->next(&persp0) || - !fuzz->next(&persp1) || - !fuzz->next(&persp2)) { + if (!fuzz->next(&scaleX) || + !fuzz->next(&skewX) || + !fuzz->next(&transX) || + !fuzz->next(&skewY) || + !fuzz->next(&scaleY) || + !fuzz->next(&transY) || + !fuzz->next(&persp0) || + !fuzz->next(&persp1) || + !fuzz->next(&persp2)) { return false; } m->setAll(scaleX, skewX, transX, skewY, scaleY, transY, persp0, persp1, persp2); @@ -52,8 +52,8 @@ bool initGradientParams(Fuzz* fuzz, uint32_t* count, SkColor** colors, SkScalar* t_colors = new SkColor[t_count]; t_pos = new SkScalar[t_count]; for (uint32_t i = 0; i < t_count; i++) { - fuzz->next(&t_colors[i]); - fuzz->next(&t_pos[i]); + fuzz->next(&t_colors[i]); + fuzz->next(&t_pos[i]); } if (t_count == 0) { @@ -76,12 +76,12 @@ bool initGradientParams(Fuzz* fuzz, uint32_t* count, SkColor** colors, SkScalar* void fuzzLinearGradient(Fuzz* fuzz) { SkScalar a, b, c, d; bool useLocalMatrix, useGlobalMatrix; - if (!fuzz->next(&a) || - !fuzz->next(&b) || - !fuzz->next(&c) || - !fuzz->next(&d) || - !fuzz->next(&useLocalMatrix) || - !fuzz->next(&useGlobalMatrix)) { + if (!fuzz->next(&a) || + !fuzz->next(&b) || + !fuzz->next(&c) || + !fuzz->next(&d) || + !fuzz->next(&useLocalMatrix) || + !fuzz->next(&useGlobalMatrix)) { return; } SkPoint pts[2] = {SkPoint::Make(a,b), SkPoint::Make(c, d)}; @@ -124,11 +124,11 @@ void fuzzLinearGradient(Fuzz* fuzz) { void fuzzRadialGradient(Fuzz* fuzz) { SkScalar a, b, radius; bool useLocalMatrix, useGlobalMatrix; - if (!fuzz->next(&a) || - !fuzz->next(&b) || - !fuzz->next(&radius) || - !fuzz->next(&useLocalMatrix) || - !fuzz->next(&useGlobalMatrix)) { + if (!fuzz->next(&a) || + !fuzz->next(&b) || + !fuzz->next(&radius) || + !fuzz->next(&useLocalMatrix) || + !fuzz->next(&useGlobalMatrix)) { return; } SkPoint center = SkPoint::Make(a,b); @@ -172,14 +172,14 @@ void fuzzRadialGradient(Fuzz* fuzz) { void fuzzTwoPointConicalGradient(Fuzz* fuzz) { SkScalar a, b, startRadius, c, d, endRadius; bool useLocalMatrix, useGlobalMatrix; - if (!fuzz->next(&a) || - !fuzz->next(&b) || - !fuzz->next(&startRadius) || - !fuzz->next(&c) || - !fuzz->next(&d) || - !fuzz->next(&endRadius) || - !fuzz->next(&useLocalMatrix) || - !fuzz->next(&useGlobalMatrix)) { + if (!fuzz->next(&a) || + !fuzz->next(&b) || + !fuzz->next(&startRadius) || + !fuzz->next(&c) || + !fuzz->next(&d) || + !fuzz->next(&endRadius) || + !fuzz->next(&useLocalMatrix) || + !fuzz->next(&useGlobalMatrix)) { return; } SkPoint start = SkPoint::Make(a, b); @@ -223,10 +223,10 @@ void fuzzTwoPointConicalGradient(Fuzz* fuzz) { void fuzzSweepGradient(Fuzz* fuzz) { SkScalar cx, cy; bool useLocalMatrix, useGlobalMatrix; - if (!fuzz->next(&cx) || - !fuzz->next(&cy) || - !fuzz->next(&useLocalMatrix) || - !fuzz->next(&useGlobalMatrix)) { + if (!fuzz->next(&cx) || + !fuzz->next(&cy) || + !fuzz->next(&useLocalMatrix) || + !fuzz->next(&useGlobalMatrix)) { return; } @@ -270,7 +270,7 @@ void fuzzSweepGradient(Fuzz* fuzz) { DEF_FUZZ(Gradients, fuzz) { uint8_t i; - if (!fuzz->next(&i)) { + if (!fuzz->next(&i)) { return; } -- cgit v1.2.3