diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-02-04 22:57:21 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-02-04 22:57:21 +0000 |
commit | 377c14a1e648f4427bd11474fad8ac264d98aff2 (patch) | |
tree | 57451f699ed100c774bc37644aee2e124001d72e | |
parent | 3d5b998bd7415d23469360425b0d5ddbf3f284cc (diff) |
Nuke SkSingleInputImageFilter. 99% of its functionality was refactored into SkImageFilterUtils in https://code.google.com/p/skia/source/detail?r=7467, so it has outlived its usefulness.
Review URL: https://codereview.appspot.com/7277055
git-svn-id: http://skia.googlecode.com/svn/trunk@7563 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | gyp/effects.gypi | 2 | ||||
-rw-r--r-- | include/effects/SkBicubicImageFilter.h | 6 | ||||
-rw-r--r-- | include/effects/SkBlurImageFilter.h | 6 | ||||
-rwxr-xr-x | include/effects/SkColorFilterImageFilter.h | 6 | ||||
-rw-r--r-- | include/effects/SkLightingImageFilter.h | 6 | ||||
-rw-r--r-- | include/effects/SkMatrixConvolutionImageFilter.h | 6 | ||||
-rw-r--r-- | include/effects/SkMorphologyImageFilter.h | 6 | ||||
-rw-r--r-- | include/effects/SkOffsetImageFilter.h | 6 | ||||
-rw-r--r-- | include/effects/SkSingleInputImageFilter.h | 37 | ||||
-rw-r--r-- | src/effects/SkBicubicImageFilter.cpp | 2 | ||||
-rw-r--r-- | src/effects/SkBlurImageFilter.cpp | 2 | ||||
-rwxr-xr-x | src/effects/SkColorFilterImageFilter.cpp | 2 | ||||
-rw-r--r-- | src/effects/SkMatrixConvolutionImageFilter.cpp | 4 | ||||
-rw-r--r-- | src/effects/SkMorphologyImageFilter.cpp | 4 | ||||
-rw-r--r-- | src/effects/SkOffsetImageFilter.cpp | 2 | ||||
-rw-r--r-- | src/effects/SkSingleInputImageFilter.cpp | 32 |
16 files changed, 29 insertions, 100 deletions
diff --git a/gyp/effects.gypi b/gyp/effects.gypi index 44d846a40a..31584dff13 100644 --- a/gyp/effects.gypi +++ b/gyp/effects.gypi @@ -43,7 +43,6 @@ '<(skia_src_path)/effects/SkPaintFlagsDrawFilter.cpp', '<(skia_src_path)/effects/SkPixelXorXfermode.cpp', '<(skia_src_path)/effects/SkPorterDuff.cpp', - '<(skia_src_path)/effects/SkSingleInputImageFilter.cpp', '<(skia_src_path)/effects/SkStippleMaskFilter.cpp', '<(skia_src_path)/effects/SkTableColorFilter.cpp', '<(skia_src_path)/effects/SkTableMaskFilter.cpp', @@ -98,7 +97,6 @@ '<(skia_include_path)/effects/SkPaintFlagsDrawFilter.h', '<(skia_include_path)/effects/SkPixelXorXfermode.h', '<(skia_include_path)/effects/SkPorterDuff.h', - '<(skia_include_path)/effects/SkSingleInputImageFilter.h', '<(skia_include_path)/effects/SkStippleMaskFilter.h', '<(skia_include_path)/effects/SkTableColorFilter.h', '<(skia_include_path)/effects/SkTableMaskFilter.h', diff --git a/include/effects/SkBicubicImageFilter.h b/include/effects/SkBicubicImageFilter.h index cb856fbaa2..119c07958e 100644 --- a/include/effects/SkBicubicImageFilter.h +++ b/include/effects/SkBicubicImageFilter.h @@ -8,7 +8,7 @@ #ifndef SkBicubicImageFilter_DEFINED #define SkBicubicImageFilter_DEFINED -#include "SkSingleInputImageFilter.h" +#include "SkImageFilter.h" #include "SkScalar.h" #include "SkSize.h" #include "SkPoint.h" @@ -18,7 +18,7 @@ filter using the given matrix. */ -class SK_API SkBicubicImageFilter : public SkSingleInputImageFilter { +class SK_API SkBicubicImageFilter : public SkImageFilter { public: /** Construct a (scaling-only) bicubic resampling image filter. @param scale How much to scale the image. @@ -48,7 +48,7 @@ protected: private: SkSize fScale; SkScalar fCoefficients[16]; - typedef SkSingleInputImageFilter INHERITED; + typedef SkImageFilter INHERITED; }; #endif diff --git a/include/effects/SkBlurImageFilter.h b/include/effects/SkBlurImageFilter.h index 018718fcc2..80ea9e5c92 100644 --- a/include/effects/SkBlurImageFilter.h +++ b/include/effects/SkBlurImageFilter.h @@ -8,10 +8,10 @@ #ifndef SkBlurImageFilter_DEFINED #define SkBlurImageFilter_DEFINED -#include "SkSingleInputImageFilter.h" +#include "SkImageFilter.h" #include "SkSize.h" -class SK_API SkBlurImageFilter : public SkSingleInputImageFilter { +class SK_API SkBlurImageFilter : public SkImageFilter { public: SkBlurImageFilter(SkScalar sigmaX, SkScalar sigmaY, SkImageFilter* input = NULL); @@ -29,7 +29,7 @@ protected: private: SkSize fSigma; - typedef SkSingleInputImageFilter INHERITED; + typedef SkImageFilter INHERITED; }; #endif diff --git a/include/effects/SkColorFilterImageFilter.h b/include/effects/SkColorFilterImageFilter.h index bff9293816..362e04f200 100755 --- a/include/effects/SkColorFilterImageFilter.h +++ b/include/effects/SkColorFilterImageFilter.h @@ -8,11 +8,11 @@ #ifndef SkColorFilterImageFilter_DEFINED #define SkColorFilterImageFilter_DEFINED -#include "SkSingleInputImageFilter.h" +#include "SkImageFilter.h" class SkColorFilter; -class SK_API SkColorFilterImageFilter : public SkSingleInputImageFilter { +class SK_API SkColorFilterImageFilter : public SkImageFilter { public: static SkColorFilterImageFilter* Create(SkColorFilter* cf, SkImageFilter* input = NULL); virtual ~SkColorFilterImageFilter(); @@ -32,7 +32,7 @@ private: SkColorFilterImageFilter(SkColorFilter* cf, SkImageFilter* input); SkColorFilter* fColorFilter; - typedef SkSingleInputImageFilter INHERITED; + typedef SkImageFilter INHERITED; }; #endif diff --git a/include/effects/SkLightingImageFilter.h b/include/effects/SkLightingImageFilter.h index da95b7bf31..5e9028d92a 100644 --- a/include/effects/SkLightingImageFilter.h +++ b/include/effects/SkLightingImageFilter.h @@ -9,7 +9,7 @@ #ifndef SkLightingImageFilter_DEFINED #define SkLightingImageFilter_DEFINED -#include "SkSingleInputImageFilter.h" +#include "SkImageFilter.h" #include "SkColor.h" class SK_API SkPoint3 { @@ -47,7 +47,7 @@ public: class SkLight; -class SK_API SkLightingImageFilter : public SkSingleInputImageFilter { +class SK_API SkLightingImageFilter : public SkImageFilter { public: static SkImageFilter* CreateDistantLitDiffuse(const SkPoint3& direction, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, @@ -81,7 +81,7 @@ protected: SkScalar surfaceScale() const { return fSurfaceScale; } private: - typedef SkSingleInputImageFilter INHERITED; + typedef SkImageFilter INHERITED; SkLight* fLight; SkScalar fSurfaceScale; }; diff --git a/include/effects/SkMatrixConvolutionImageFilter.h b/include/effects/SkMatrixConvolutionImageFilter.h index 09cb5ef2cd..cd2a16fdfe 100644 --- a/include/effects/SkMatrixConvolutionImageFilter.h +++ b/include/effects/SkMatrixConvolutionImageFilter.h @@ -8,7 +8,7 @@ #ifndef SkMatrixConvolutionImageFilter_DEFINED #define SkMatrixConvolutionImageFilter_DEFINED -#include "SkSingleInputImageFilter.h" +#include "SkImageFilter.h" #include "SkScalar.h" #include "SkSize.h" #include "SkPoint.h" @@ -19,7 +19,7 @@ effects such as sharpening, blurring, edge detection, etc. */ -class SK_API SkMatrixConvolutionImageFilter : public SkSingleInputImageFilter { +class SK_API SkMatrixConvolutionImageFilter : public SkImageFilter { public: /*! \enum TileMode */ enum TileMode { @@ -73,7 +73,7 @@ private: SkIPoint fTarget; TileMode fTileMode; bool fConvolveAlpha; - typedef SkSingleInputImageFilter INHERITED; + typedef SkImageFilter INHERITED; template <class PixelFetcher, bool convolveAlpha> void filterPixels(const SkBitmap& src, SkBitmap* result, const SkIRect& rect); diff --git a/include/effects/SkMorphologyImageFilter.h b/include/effects/SkMorphologyImageFilter.h index b4bc6767b2..a189c757de 100644 --- a/include/effects/SkMorphologyImageFilter.h +++ b/include/effects/SkMorphologyImageFilter.h @@ -9,10 +9,10 @@ #ifndef SkMorphologyImageFilter_DEFINED #define SkMorphologyImageFilter_DEFINED -#include "SkSingleInputImageFilter.h" +#include "SkImageFilter.h" #include "SkSize.h" -class SK_API SkMorphologyImageFilter : public SkSingleInputImageFilter { +class SK_API SkMorphologyImageFilter : public SkImageFilter { public: SkMorphologyImageFilter(int radiusX, int radiusY, SkImageFilter* input); @@ -27,7 +27,7 @@ protected: private: SkISize fRadius; - typedef SkSingleInputImageFilter INHERITED; + typedef SkImageFilter INHERITED; }; class SK_API SkDilateImageFilter : public SkMorphologyImageFilter { diff --git a/include/effects/SkOffsetImageFilter.h b/include/effects/SkOffsetImageFilter.h index 74d6ebc191..62b5fa6511 100644 --- a/include/effects/SkOffsetImageFilter.h +++ b/include/effects/SkOffsetImageFilter.h @@ -8,10 +8,10 @@ #ifndef SkOffsetImageFilter_DEFINED #define SkOffsetImageFilter_DEFINED -#include "SkSingleInputImageFilter.h" +#include "SkImageFilter.h" #include "SkPoint.h" -class SK_API SkOffsetImageFilter : public SkSingleInputImageFilter { +class SK_API SkOffsetImageFilter : public SkImageFilter { public: SkOffsetImageFilter(SkScalar dx, SkScalar dy, SkImageFilter* input = NULL); SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkOffsetImageFilter) @@ -27,7 +27,7 @@ protected: private: SkVector fOffset; - typedef SkSingleInputImageFilter INHERITED; + typedef SkImageFilter INHERITED; }; #endif diff --git a/include/effects/SkSingleInputImageFilter.h b/include/effects/SkSingleInputImageFilter.h deleted file mode 100644 index 3df718f8d1..0000000000 --- a/include/effects/SkSingleInputImageFilter.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2012 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef SkSingleInputImageFilter_DEFINED -#define SkSingleInputImageFilter_DEFINED - -#include "SkImageFilter.h" - -class SkMatrix; -struct SkIPoint; -class GrTexture; - -class SK_API SkSingleInputImageFilter : public SkImageFilter { -public: - SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSingleInputImageFilter) - -protected: - explicit SkSingleInputImageFilter(SkImageFilter* input); - ~SkSingleInputImageFilter(); - explicit SkSingleInputImageFilter(SkFlattenableReadBuffer& rb); - virtual void flatten(SkFlattenableWriteBuffer& wb) const SK_OVERRIDE; - - // Recurses on input (if non-NULL), and returns the processed result, - // otherwise returns src. - SkBitmap getInputResult(Proxy*, const SkBitmap& src, const SkMatrix&, - SkIPoint* offset); - - SkImageFilter* input() const { return getInput(0); } -private: - typedef SkImageFilter INHERITED; -}; - -#endif diff --git a/src/effects/SkBicubicImageFilter.cpp b/src/effects/SkBicubicImageFilter.cpp index 0670c4d3dc..1d8de0743d 100644 --- a/src/effects/SkBicubicImageFilter.cpp +++ b/src/effects/SkBicubicImageFilter.cpp @@ -78,7 +78,7 @@ bool SkBicubicImageFilter::onFilterImage(Proxy* proxy, const SkMatrix& matrix, SkBitmap* result, SkIPoint* loc) { - SkBitmap src = this->getInputResult(proxy, source, matrix, loc); + SkBitmap src = this->getInputResult(0, proxy, source, matrix, loc); if (src.config() != SkBitmap::kARGB_8888_Config) { return false; } diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp index 78359d2130..4885070264 100644 --- a/src/effects/SkBlurImageFilter.cpp +++ b/src/effects/SkBlurImageFilter.cpp @@ -137,7 +137,7 @@ static void getBox3Params(SkScalar s, int *kernelSize, int* kernelSize3, int *lo bool SkBlurImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source, const SkMatrix& ctm, SkBitmap* dst, SkIPoint* offset) { - SkBitmap src = this->getInputResult(proxy, source, ctm, offset); + SkBitmap src = this->getInputResult(0, proxy, source, ctm, offset); if (src.config() != SkBitmap::kARGB_8888_Config) { return false; } diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp index 369f782d18..549a6867df 100755 --- a/src/effects/SkColorFilterImageFilter.cpp +++ b/src/effects/SkColorFilterImageFilter.cpp @@ -97,7 +97,7 @@ bool SkColorFilterImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& sourc const SkMatrix& matrix, SkBitmap* result, SkIPoint* loc) { - SkBitmap src = this->getInputResult(proxy, source, matrix, loc); + SkBitmap src = this->getInputResult(0, proxy, source, matrix, loc); SkAutoTUnref<SkDevice> device(proxy->createDevice(src.width(), src.height())); SkCanvas canvas(device.get()); SkPaint paint; diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp index 5a97ec4fae..97af7ad737 100644 --- a/src/effects/SkMatrixConvolutionImageFilter.cpp +++ b/src/effects/SkMatrixConvolutionImageFilter.cpp @@ -173,7 +173,7 @@ void SkMatrixConvolutionImageFilter::filterBorderPixels(const SkBitmap& src, SkB } } -// FIXME: This should be refactored to SkSingleInputImageFilter for +// FIXME: This should be refactored to SkImageFilterUtils for // use by other filters. For now, we assume the input is always // premultiplied and unpremultiply it static SkBitmap unpremultiplyBitmap(const SkBitmap& src) @@ -203,7 +203,7 @@ bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy, const SkMatrix& matrix, SkBitmap* result, SkIPoint* loc) { - SkBitmap src = this->getInputResult(proxy, source, matrix, loc); + SkBitmap src = this->getInputResult(0, proxy, source, matrix, loc); if (src.config() != SkBitmap::kARGB_8888_Config) { return false; } diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index 09d79265ca..801003430d 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -136,7 +136,7 @@ static void dilateY(const SkBitmap& src, SkBitmap* dst, int radiusY) bool SkErodeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source, const SkMatrix& ctm, SkBitmap* dst, SkIPoint* offset) { - SkBitmap src = this->getInputResult(proxy, source, ctm, offset); + SkBitmap src = this->getInputResult(0, proxy, source, ctm, offset); if (src.config() != SkBitmap::kARGB_8888_Config) { return false; } @@ -181,7 +181,7 @@ bool SkErodeImageFilter::onFilterImage(Proxy* proxy, bool SkDilateImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source, const SkMatrix& ctm, SkBitmap* dst, SkIPoint* offset) { - SkBitmap src = this->getInputResult(proxy, source, ctm, offset); + SkBitmap src = this->getInputResult(0, proxy, source, ctm, offset); if (src.config() != SkBitmap::kARGB_8888_Config) { return false; } diff --git a/src/effects/SkOffsetImageFilter.cpp b/src/effects/SkOffsetImageFilter.cpp index fb39aa8e41..2a4f71c0b2 100644 --- a/src/effects/SkOffsetImageFilter.cpp +++ b/src/effects/SkOffsetImageFilter.cpp @@ -14,7 +14,7 @@ bool SkOffsetImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source, const SkMatrix& matrix, SkBitmap* result, SkIPoint* loc) { - SkBitmap src = this->getInputResult(proxy, source, matrix, loc); + SkBitmap src = this->getInputResult(0, proxy, source, matrix, loc); SkVector vec; matrix.mapVectors(&vec, &fOffset, 1); diff --git a/src/effects/SkSingleInputImageFilter.cpp b/src/effects/SkSingleInputImageFilter.cpp deleted file mode 100644 index 9e45c35055..0000000000 --- a/src/effects/SkSingleInputImageFilter.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2012 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "SkSingleInputImageFilter.h" -#include "SkBitmap.h" -#include "SkFlattenableBuffers.h" -#include "SkMatrix.h" - -SkSingleInputImageFilter::SkSingleInputImageFilter(SkImageFilter* input) : INHERITED(input) { -} - -SkSingleInputImageFilter::~SkSingleInputImageFilter() { -} - -SkSingleInputImageFilter::SkSingleInputImageFilter(SkFlattenableReadBuffer& rb) - : INHERITED(rb) { -} - -void SkSingleInputImageFilter::flatten(SkFlattenableWriteBuffer& wb) const { - this->INHERITED::flatten(wb); -} - -SkBitmap SkSingleInputImageFilter::getInputResult(Proxy* proxy, - const SkBitmap& src, - const SkMatrix& ctm, - SkIPoint* offset) { - return this->INHERITED::getInputResult(0, proxy, src, ctm, offset); -} |