Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(759)

Side by Side Diff: fuzz/fuzz.cpp

Issue 1878363002: Make fuzz builds set SK_FUZZ_LOGGING (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fuzz/FilterFuzz.cpp ('k') | gyp/fuzz.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Fuzz.h" 8 #include "Fuzz.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCodec.h" 10 #include "SkCodec.h"
11 #include "SkCommandLineFlags.h" 11 #include "SkCommandLineFlags.h"
12 #include "SkData.h" 12 #include "SkData.h"
13 #include "SkForceLinking.h"
14 #include "SkImage.h" 13 #include "SkImage.h"
15 #include "SkImageEncoder.h" 14 #include "SkImageEncoder.h"
16 #include "SkMallocPixelRef.h" 15 #include "SkMallocPixelRef.h"
17 #include "SkPicture.h" 16 #include "SkPicture.h"
18 #include "SkStream.h" 17 #include "SkStream.h"
19 18
20 #include <cmath> 19 #include <cmath>
21 #include <signal.h> 20 #include <signal.h>
22 #include <stdlib.h> 21 #include <stdlib.h>
23 22
24 // TODO(kjlubick): Remove once http://crrev.com/1671193002 lands
25 __SK_FORCE_IMAGE_DECODER_LINKING;
26
27 DEFINE_string2(bytes, b, "", "A path to a file. This can be the fuzz bytes or a binary to parse."); 23 DEFINE_string2(bytes, b, "", "A path to a file. This can be the fuzz bytes or a binary to parse.");
28 DEFINE_string2(name, n, "", "If --type is 'api', fuzz the API with this name."); 24 DEFINE_string2(name, n, "", "If --type is 'api', fuzz the API with this name.");
29 25
30 DEFINE_string2(type, t, "api", "How to interpret --bytes, either 'image_scale', 'image_mode', 'skp', or 'api'."); 26 DEFINE_string2(type, t, "api", "How to interpret --bytes, either 'image_scale', 'image_mode', 'skp', or 'api'.");
31 DEFINE_string2(dump, d, "", "If not empty, dump 'image*' or 'skp' types as a PNG with this name."); 27 DEFINE_string2(dump, d, "", "If not empty, dump 'image*' or 'skp' types as a PNG with this name.");
32 28
33 static int printUsage(const char* name) { 29 static int printUsage(const char* name) {
34 SkDebugf("Usage: %s -t <type> -b <path/to/file> [-n api-to-fuzz]\n", name); 30 SkDebugf("Usage: %s -t <type> -b <path/to/file> [-n api-to-fuzz]\n", name);
35 return 1; 31 return 1;
36 } 32 }
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 if (min > max) { 417 if (min > max) {
422 SkDebugf("Check mins and maxes (%f, %f)\n", min, max); 418 SkDebugf("Check mins and maxes (%f, %f)\n", min, max);
423 this->signalBoring(); 419 this->signalBoring();
424 } 420 }
425 float f = std::abs(this->nextF()); 421 float f = std::abs(this->nextF());
426 if (!std::isnormal(f) && f != 0.0) { 422 if (!std::isnormal(f) && f != 0.0) {
427 this->signalBoring(); 423 this->signalBoring();
428 } 424 }
429 return min + fmod(f, (max - min + 1)); 425 return min + fmod(f, (max - min + 1));
430 } 426 }
OLDNEW
« no previous file with comments | « fuzz/FilterFuzz.cpp ('k') | gyp/fuzz.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698