aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-05 22:32:02 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-05 22:32:02 +0000
commitae761f7545d8ebf181d220169afac2056b057b8c (patch)
tree73cf6f3c8e384ad332956319046e6536bed97ba4 /include/effects
parentd2e88f67c9678fbda24ff74039fc1f3aae603e74 (diff)
Make SkImageFilter methods const.
SkImageFilter had some non-const methods that could all be made const. This is a first step towards making SkImageFilter immutable. BUG=skia:2097 R=mtklein@google.com, reed@google.com, robertphillips@google.com Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/148883011 git-svn-id: http://skia.googlecode.com/svn/trunk@13330 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/effects')
-rw-r--r--include/effects/SkBicubicImageFilter.h4
-rw-r--r--include/effects/SkBitmapSource.h2
-rw-r--r--include/effects/SkBlurImageFilter.h4
-rwxr-xr-xinclude/effects/SkColorFilterImageFilter.h2
-rw-r--r--include/effects/SkComposeImageFilter.h2
-rw-r--r--include/effects/SkDisplacementMapEffect.h6
-rw-r--r--include/effects/SkDropShadowImageFilter.h2
-rw-r--r--include/effects/SkMagnifierImageFilter.h2
-rw-r--r--include/effects/SkMatrixConvolutionImageFilter.h10
-rwxr-xr-xinclude/effects/SkMergeImageFilter.h2
-rw-r--r--include/effects/SkMorphologyImageFilter.h12
-rw-r--r--include/effects/SkOffsetImageFilter.h2
-rw-r--r--include/effects/SkPictureImageFilter.h2
-rw-r--r--include/effects/SkRectShaderImageFilter.h2
-rw-r--r--include/effects/SkResizeImageFilter.h2
-rwxr-xr-xinclude/effects/SkTestImageFilters.h2
-rw-r--r--include/effects/SkTileImageFilter.h2
-rw-r--r--include/effects/SkXfermodeImageFilter.h4
18 files changed, 31 insertions, 33 deletions
diff --git a/include/effects/SkBicubicImageFilter.h b/include/effects/SkBicubicImageFilter.h
index d321169b71..48105b1c5b 100644
--- a/include/effects/SkBicubicImageFilter.h
+++ b/include/effects/SkBicubicImageFilter.h
@@ -39,12 +39,12 @@ protected:
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* loc) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
#if SK_SUPPORT_GPU
virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; }
virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
#endif
private:
diff --git a/include/effects/SkBitmapSource.h b/include/effects/SkBitmapSource.h
index fa6dafc3a5..fcc1db97bc 100644
--- a/include/effects/SkBitmapSource.h
+++ b/include/effects/SkBitmapSource.h
@@ -23,7 +23,7 @@ protected:
explicit SkBitmapSource(SkReadBuffer& buffer);
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
virtual bool onFilterBounds(const SkIRect& src, const SkMatrix& ctm, SkIRect* dst) const SK_OVERRIDE;
private:
diff --git a/include/effects/SkBlurImageFilter.h b/include/effects/SkBlurImageFilter.h
index f35269179b..60dab729b4 100644
--- a/include/effects/SkBlurImageFilter.h
+++ b/include/effects/SkBlurImageFilter.h
@@ -26,13 +26,13 @@ protected:
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&,
SkIRect* dst) const SK_OVERRIDE;
bool canFilterImageGPU() const SK_OVERRIDE { return true; }
virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
private:
SkSize fSigma;
diff --git a/include/effects/SkColorFilterImageFilter.h b/include/effects/SkColorFilterImageFilter.h
index c04e418f29..d127f36db3 100755
--- a/include/effects/SkColorFilterImageFilter.h
+++ b/include/effects/SkColorFilterImageFilter.h
@@ -26,7 +26,7 @@ protected:
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* loc) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
virtual bool asColorFilter(SkColorFilter**) const SK_OVERRIDE;
diff --git a/include/effects/SkComposeImageFilter.h b/include/effects/SkComposeImageFilter.h
index 9cf7465a42..9e024ef84e 100644
--- a/include/effects/SkComposeImageFilter.h
+++ b/include/effects/SkComposeImageFilter.h
@@ -21,7 +21,7 @@ protected:
explicit SkComposeImageFilter(SkReadBuffer& buffer);
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* loc) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) const SK_OVERRIDE;
private:
diff --git a/include/effects/SkDisplacementMapEffect.h b/include/effects/SkDisplacementMapEffect.h
index de07fe4ca4..5de4814951 100644
--- a/include/effects/SkDisplacementMapEffect.h
+++ b/include/effects/SkDisplacementMapEffect.h
@@ -36,7 +36,7 @@ public:
const SkBitmap& src,
const SkMatrix& ctm,
SkBitmap* dst,
- SkIPoint* offset) SK_OVERRIDE;
+ SkIPoint* offset) const SK_OVERRIDE;
virtual void computeFastBounds(const SkRect& src, SkRect* dst) const SK_OVERRIDE;
virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&,
@@ -45,7 +45,7 @@ public:
#if SK_SUPPORT_GPU
virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; }
virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
#endif
protected:
@@ -57,8 +57,6 @@ private:
ChannelSelectorType fYChannelSelector;
SkScalar fScale;
typedef SkImageFilter INHERITED;
- SkImageFilter* getDisplacementInput() { return getInput(0); }
- SkImageFilter* getColorInput() { return getInput(1); }
const SkImageFilter* getDisplacementInput() const { return getInput(0); }
const SkImageFilter* getColorInput() const { return getInput(1); }
};
diff --git a/include/effects/SkDropShadowImageFilter.h b/include/effects/SkDropShadowImageFilter.h
index cfcad8c33b..aba2017eef 100644
--- a/include/effects/SkDropShadowImageFilter.h
+++ b/include/effects/SkDropShadowImageFilter.h
@@ -19,7 +19,7 @@ public:
protected:
explicit SkDropShadowImageFilter(SkReadBuffer&);
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
- virtual bool onFilterImage(Proxy*, const SkBitmap& source, const SkMatrix&, SkBitmap* result, SkIPoint* loc) SK_OVERRIDE;
+ virtual bool onFilterImage(Proxy*, const SkBitmap& source, const SkMatrix&, SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&,
SkIRect* dst) const SK_OVERRIDE;
diff --git a/include/effects/SkMagnifierImageFilter.h b/include/effects/SkMagnifierImageFilter.h
index 222abd1283..44f0d0d689 100644
--- a/include/effects/SkMagnifierImageFilter.h
+++ b/include/effects/SkMagnifierImageFilter.h
@@ -23,7 +23,7 @@ protected:
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
#if SK_SUPPORT_GPU
virtual bool asNewEffect(GrEffectRef** effect, GrTexture* texture, const SkMatrix& matrix, const SkIRect& bounds) const SK_OVERRIDE;
#endif
diff --git a/include/effects/SkMatrixConvolutionImageFilter.h b/include/effects/SkMatrixConvolutionImageFilter.h
index 8da556e918..59af83e025 100644
--- a/include/effects/SkMatrixConvolutionImageFilter.h
+++ b/include/effects/SkMatrixConvolutionImageFilter.h
@@ -68,7 +68,7 @@ protected:
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* loc) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
#if SK_SUPPORT_GPU
virtual bool asNewEffect(GrEffectRef** effect,
@@ -91,20 +91,20 @@ private:
void filterPixels(const SkBitmap& src,
SkBitmap* result,
const SkIRect& rect,
- const SkIRect& bounds);
+ const SkIRect& bounds) const;
template <class PixelFetcher>
void filterPixels(const SkBitmap& src,
SkBitmap* result,
const SkIRect& rect,
- const SkIRect& bounds);
+ const SkIRect& bounds) const;
void filterInteriorPixels(const SkBitmap& src,
SkBitmap* result,
const SkIRect& rect,
- const SkIRect& bounds);
+ const SkIRect& bounds) const;
void filterBorderPixels(const SkBitmap& src,
SkBitmap* result,
const SkIRect& rect,
- const SkIRect& bounds);
+ const SkIRect& bounds) const;
};
#endif
diff --git a/include/effects/SkMergeImageFilter.h b/include/effects/SkMergeImageFilter.h
index 74cf561fd7..36eaaf3df1 100755
--- a/include/effects/SkMergeImageFilter.h
+++ b/include/effects/SkMergeImageFilter.h
@@ -29,7 +29,7 @@ protected:
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* loc) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
private:
uint8_t* fModes; // SkXfermode::Mode
diff --git a/include/effects/SkMorphologyImageFilter.h b/include/effects/SkMorphologyImageFilter.h
index c2b0d13eb3..4d60180aeb 100644
--- a/include/effects/SkMorphologyImageFilter.h
+++ b/include/effects/SkMorphologyImageFilter.h
@@ -32,14 +32,14 @@ public:
protected:
bool filterImageGeneric(Proc procX, Proc procY,
Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* offset);
+ SkBitmap* result, SkIPoint* offset) const;
SkMorphologyImageFilter(SkReadBuffer& buffer);
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
#if SK_SUPPORT_GPU
virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; }
bool filterImageGPUGeneric(bool dilate, Proxy* proxy, const SkBitmap& src,
const SkMatrix& ctm, SkBitmap* result,
- SkIPoint* offset);
+ SkIPoint* offset) const;
#endif
SkISize radius() const { return fRadius; }
@@ -57,10 +57,10 @@ public:
: INHERITED(radiusX, radiusY, input, cropRect) {}
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
#if SK_SUPPORT_GPU
virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
#endif
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter)
@@ -80,10 +80,10 @@ public:
: INHERITED(radiusX, radiusY, input, cropRect) {}
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
#if SK_SUPPORT_GPU
virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
#endif
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter)
diff --git a/include/effects/SkOffsetImageFilter.h b/include/effects/SkOffsetImageFilter.h
index aef158c539..31eead3ded 100644
--- a/include/effects/SkOffsetImageFilter.h
+++ b/include/effects/SkOffsetImageFilter.h
@@ -25,7 +25,7 @@ protected:
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* loc) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) const SK_OVERRIDE;
private:
diff --git a/include/effects/SkPictureImageFilter.h b/include/effects/SkPictureImageFilter.h
index ccda85d3ac..eeaf1d2e46 100644
--- a/include/effects/SkPictureImageFilter.h
+++ b/include/effects/SkPictureImageFilter.h
@@ -31,7 +31,7 @@ protected:
explicit SkPictureImageFilter(SkReadBuffer& buffer);
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
private:
SkPicture* fPicture;
diff --git a/include/effects/SkRectShaderImageFilter.h b/include/effects/SkRectShaderImageFilter.h
index 28d98cc49a..23c538e688 100644
--- a/include/effects/SkRectShaderImageFilter.h
+++ b/include/effects/SkRectShaderImageFilter.h
@@ -38,7 +38,7 @@ protected:
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* loc) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
private:
SkRectShaderImageFilter(SkShader* s, const CropRect* rect);
diff --git a/include/effects/SkResizeImageFilter.h b/include/effects/SkResizeImageFilter.h
index e2747e7bf4..cc02a01d03 100644
--- a/include/effects/SkResizeImageFilter.h
+++ b/include/effects/SkResizeImageFilter.h
@@ -40,7 +40,7 @@ protected:
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* loc) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
private:
SkScalar fSx, fSy;
diff --git a/include/effects/SkTestImageFilters.h b/include/effects/SkTestImageFilters.h
index 66ef5b1e68..abbaa92593 100755
--- a/include/effects/SkTestImageFilters.h
+++ b/include/effects/SkTestImageFilters.h
@@ -16,7 +16,7 @@ protected:
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
- SkBitmap* result, SkIPoint* loc) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
private:
SkScalar fScale;
diff --git a/include/effects/SkTileImageFilter.h b/include/effects/SkTileImageFilter.h
index 095b976445..390e00c9a4 100644
--- a/include/effects/SkTileImageFilter.h
+++ b/include/effects/SkTileImageFilter.h
@@ -23,7 +23,7 @@ public:
: INHERITED(input), fSrcRect(srcRect), fDstRect(dstRect) {}
virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
- SkBitmap* dst, SkIPoint* offset) SK_OVERRIDE;
+ SkBitmap* dst, SkIPoint* offset) const SK_OVERRIDE;
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTileImageFilter)
diff --git a/include/effects/SkXfermodeImageFilter.h b/include/effects/SkXfermodeImageFilter.h
index e2724c3507..602dc48404 100644
--- a/include/effects/SkXfermodeImageFilter.h
+++ b/include/effects/SkXfermodeImageFilter.h
@@ -32,11 +32,11 @@ public:
const SkBitmap& src,
const SkMatrix& ctm,
SkBitmap* dst,
- SkIPoint* offset) SK_OVERRIDE;
+ SkIPoint* offset) const SK_OVERRIDE;
#if SK_SUPPORT_GPU
virtual bool canFilterImageGPU() const SK_OVERRIDE { return !cropRectIsSet(); }
virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
+ SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
#endif
protected: