Permalink
Browse files

Nuke SkSingleInputImageFilter. 99% of its functionality was refactore…

…d 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
  • Loading branch information...
1 parent fe2dc0d commit 7696fef142b69314ac9cb63b0c9968b189bc24e8 senorblanco@chromium.org committed Feb 4, 2013
View
@@ -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',
@@ -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 @@ class SK_API SkBicubicImageFilter : public SkSingleInputImageFilter {
private:
SkSize fScale;
SkScalar fCoefficients[16];
- typedef SkSingleInputImageFilter INHERITED;
+ typedef SkImageFilter INHERITED;
};
#endif
@@ -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 @@ class SK_API SkBlurImageFilter : public SkSingleInputImageFilter {
private:
SkSize fSigma;
- typedef SkSingleInputImageFilter INHERITED;
+ typedef SkImageFilter INHERITED;
};
#endif
@@ -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 @@ class SK_API SkColorFilterImageFilter : public SkSingleInputImageFilter {
SkColorFilterImageFilter(SkColorFilter* cf, SkImageFilter* input);
SkColorFilter* fColorFilter;
- typedef SkSingleInputImageFilter INHERITED;
+ typedef SkImageFilter INHERITED;
};
#endif
@@ -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 @@ class SK_API SkPoint3 {
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 @@ class SK_API SkLightingImageFilter : public SkSingleInputImageFilter {
SkScalar surfaceScale() const { return fSurfaceScale; }
private:
- typedef SkSingleInputImageFilter INHERITED;
+ typedef SkImageFilter INHERITED;
SkLight* fLight;
SkScalar fSurfaceScale;
};
@@ -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 @@ class SK_API SkMatrixConvolutionImageFilter : public SkSingleInputImageFilter {
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);
@@ -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 @@ class SK_API SkMorphologyImageFilter : public SkSingleInputImageFilter {
private:
SkISize fRadius;
- typedef SkSingleInputImageFilter INHERITED;
+ typedef SkImageFilter INHERITED;
};
class SK_API SkDilateImageFilter : public SkMorphologyImageFilter {
@@ -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 @@ class SK_API SkOffsetImageFilter : public SkSingleInputImageFilter {
private:
SkVector fOffset;
- typedef SkSingleInputImageFilter INHERITED;
+ typedef SkImageFilter INHERITED;
};
#endif
@@ -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
@@ -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;
}
@@ -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;
}
@@ -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;
@@ -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;
}
@@ -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;
}
@@ -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);
@@ -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);
-}

0 comments on commit 7696fef

Please sign in to comment.