diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkFuzzLogging.h | 23 | ||||
-rw-r--r-- | src/core/SkImageFilter.cpp | 2 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/core/SkFuzzLogging.h b/src/core/SkFuzzLogging.h new file mode 100644 index 0000000000..8e546e3a06 --- /dev/null +++ b/src/core/SkFuzzLogging.h @@ -0,0 +1,23 @@ +/* + * Copyright 2016 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef SkFuzzLogging_DEFINED +#define SkFuzzLogging_DEFINED + +// Utilities for Skia's fuzzer + +// When SK_FUZZ_LOGGING is defined SkDebugfs relevant to image filter fuzzing +// will be enabled. This allows the filter fuzzing code to white list fuzzer +// failures based on the output logs. +// Define this flag in your SkUserConfig.h or in your Make/Build system. +#ifdef SK_FUZZ_LOGGING + #define SkFUZZF(args) SkDebugf("SkFUZZ: "); SkDebugf args +#else + #define SkFUZZF(args) +#endif + +#endif diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp index fb5c9157b6..4af335ef41 100644 --- a/src/core/SkImageFilter.cpp +++ b/src/core/SkImageFilter.cpp @@ -12,6 +12,7 @@ #include "SkBitmapDevice.h" #include "SkChecksum.h" #include "SkDevice.h" +#include "SkFuzzLogging.h" #include "SkLocalMatrixImageFilter.h" #include "SkMatrixImageFilter.h" #include "SkOncePtr.h" @@ -137,6 +138,7 @@ bool SkImageFilter::Common::unflatten(SkReadBuffer& buffer, int expectedCount) { return false; } + SkFUZZF(("allocInputs: %d\n", count)); this->allocInputs(count); for (int i = 0; i < count; i++) { if (buffer.readBool()) { |