diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-10-22 15:07:14 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-10-22 15:07:14 +0000 |
commit | c2e8cef4792b478547973d312b26fff4aab7c729 (patch) | |
tree | 2280a80d41cba106ab1122e37e7b2b6a4a110b4c /src | |
parent | d7bafb700c62dff466a88bee81d793e51737284b (diff) |
Remove use of varargs in SkImageFilter. This is causing a crash in recent
builds of clang. (It was also masking the fact that SkMergeImageFilter was
calling the wrong constructor!)
Review URL: https://codereview.appspot.com/6709066
git-svn-id: http://skia.googlecode.com/svn/trunk@6029 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkImageFilter.cpp | 22 | ||||
-rw-r--r-- | src/effects/SkBlendImageFilter.cpp | 2 | ||||
-rw-r--r-- | src/effects/SkSingleInputImageFilter.cpp | 2 | ||||
-rwxr-xr-x | src/effects/SkTestImageFilters.cpp | 4 |
4 files changed, 16 insertions, 14 deletions
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp index 45ad024d45..b5a7b1b9ac 100644 --- a/src/core/SkImageFilter.cpp +++ b/src/core/SkImageFilter.cpp @@ -10,7 +10,6 @@ #include "SkBitmap.h" #include "SkFlattenableBuffers.h" #include "SkRect.h" -#include "stdarg.h" SK_DEFINE_INST_COUNT(SkImageFilter) @@ -22,15 +21,18 @@ SkImageFilter::SkImageFilter(int inputCount, SkImageFilter** inputs) } } -SkImageFilter::SkImageFilter(int inputCount, ...) - : fInputCount(inputCount), fInputs(new SkImageFilter*[inputCount]) { - va_list ap; - va_start(ap, inputCount); - for (int i = 0; i < inputCount; ++i) { - fInputs[i] = va_arg(ap, SkImageFilter*); - SkSafeRef(fInputs[i]); - } - va_end(ap); +SkImageFilter::SkImageFilter(SkImageFilter* input) + : fInputCount(1), fInputs(new SkImageFilter*[1]) { + fInputs[0] = input; + SkSafeRef(fInputs[0]); +} + +SkImageFilter::SkImageFilter(SkImageFilter* input1, SkImageFilter* input2) + : fInputCount(2), fInputs(new SkImageFilter*[2]) { + fInputs[0] = input1; + fInputs[1] = input2; + SkSafeRef(fInputs[0]); + SkSafeRef(fInputs[1]); } SkImageFilter::~SkImageFilter() { diff --git a/src/effects/SkBlendImageFilter.cpp b/src/effects/SkBlendImageFilter.cpp index 1fa3c0da6b..d14b5fc612 100644 --- a/src/effects/SkBlendImageFilter.cpp +++ b/src/effects/SkBlendImageFilter.cpp @@ -52,7 +52,7 @@ SkPMColor multiply_proc(SkPMColor src, SkPMColor dst) { /////////////////////////////////////////////////////////////////////////////// SkBlendImageFilter::SkBlendImageFilter(SkBlendImageFilter::Mode mode, SkImageFilter* background, SkImageFilter* foreground) - : INHERITED(2, background, foreground), fMode(mode) + : INHERITED(background, foreground), fMode(mode) { } diff --git a/src/effects/SkSingleInputImageFilter.cpp b/src/effects/SkSingleInputImageFilter.cpp index 2019e251e8..76150386f4 100644 --- a/src/effects/SkSingleInputImageFilter.cpp +++ b/src/effects/SkSingleInputImageFilter.cpp @@ -15,7 +15,7 @@ #include "SkGrPixelRef.h" #endif -SkSingleInputImageFilter::SkSingleInputImageFilter(SkImageFilter* input) : INHERITED(1, input) { +SkSingleInputImageFilter::SkSingleInputImageFilter(SkImageFilter* input) : INHERITED(input) { } SkSingleInputImageFilter::~SkSingleInputImageFilter() { diff --git a/src/effects/SkTestImageFilters.cpp b/src/effects/SkTestImageFilters.cpp index a672c337f7..99c80d037f 100755 --- a/src/effects/SkTestImageFilters.cpp +++ b/src/effects/SkTestImageFilters.cpp @@ -127,7 +127,7 @@ void SkMergeImageFilter::initModes(const SkXfermode::Mode modes[]) { } SkMergeImageFilter::SkMergeImageFilter(SkImageFilter* first, SkImageFilter* second, - SkXfermode::Mode mode) : INHERITED(2, first, second) { + SkXfermode::Mode mode) : INHERITED(first, second) { if (SkXfermode::kSrcOver_Mode != mode) { SkXfermode::Mode modes[] = { mode, mode }; this->initModes(modes); @@ -136,7 +136,7 @@ SkMergeImageFilter::SkMergeImageFilter(SkImageFilter* first, SkImageFilter* seco } } -SkMergeImageFilter::SkMergeImageFilter(SkImageFilter* const filters[], int count, +SkMergeImageFilter::SkMergeImageFilter(SkImageFilter* filters[], int count, const SkXfermode::Mode modes[]) : INHERITED(count, filters) { this->initModes(modes); } |