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
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index 5e70b1a..9dde6e1 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -95,17 +95,17 @@
return fBitmap;
}
-bool SkBitmapDevice::canHandleImageFilter(SkImageFilter*) {
+bool SkBitmapDevice::canHandleImageFilter(const SkImageFilter*) {
return false;
}
-bool SkBitmapDevice::filterImage(SkImageFilter* filter, const SkBitmap& src,
+bool SkBitmapDevice::filterImage(const SkImageFilter* filter, const SkBitmap& src,
const SkMatrix& ctm, SkBitmap* result,
SkIPoint* offset) {
return false;
}
-bool SkBitmapDevice::allowImageFilter(SkImageFilter*) {
+bool SkBitmapDevice::allowImageFilter(const SkImageFilter*) {
return true;
}
diff --git a/src/core/SkDeviceImageFilterProxy.h b/src/core/SkDeviceImageFilterProxy.h
index 03fcb68..800e42c 100644
--- a/src/core/SkDeviceImageFilterProxy.h
+++ b/src/core/SkDeviceImageFilterProxy.h
@@ -18,10 +18,10 @@
return fDevice->createCompatibleDevice(SkBitmap::kARGB_8888_Config,
w, h, false);
}
- virtual bool canHandleImageFilter(SkImageFilter* filter) SK_OVERRIDE {
+ virtual bool canHandleImageFilter(const SkImageFilter* filter) SK_OVERRIDE {
return fDevice->canHandleImageFilter(filter);
}
- virtual bool filterImage(SkImageFilter* filter, const SkBitmap& src,
+ virtual bool filterImage(const SkImageFilter* filter, const SkBitmap& src,
const SkMatrix& ctm,
SkBitmap* result, SkIPoint* offset) SK_OVERRIDE {
return fDevice->filterImage(filter, src, ctm, result, offset);
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 384f2dc..cd7c01b 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -94,7 +94,7 @@
bool SkImageFilter::filterImage(Proxy* proxy, const SkBitmap& src,
const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* offset) {
+ SkBitmap* result, SkIPoint* offset) const {
SkASSERT(result);
SkASSERT(offset);
/*
@@ -135,7 +135,7 @@
}
bool SkImageFilter::onFilterImage(Proxy*, const SkBitmap&, const SkMatrix&,
- SkBitmap*, SkIPoint*) {
+ SkBitmap*, SkIPoint*) const {
return false;
}
@@ -144,7 +144,7 @@
}
bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* offset) {
+ SkBitmap* result, SkIPoint* offset) const {
#if SK_SUPPORT_GPU
SkBitmap input;
SkASSERT(fInputCount == 1);
diff --git a/src/core/SkImageFilterUtils.cpp b/src/core/SkImageFilterUtils.cpp
index 204f38d..c6c534e 100644
--- a/src/core/SkImageFilterUtils.cpp
+++ b/src/core/SkImageFilterUtils.cpp
@@ -21,7 +21,7 @@
return true;
}
-bool SkImageFilterUtils::GetInputResultGPU(SkImageFilter* filter, SkImageFilter::Proxy* proxy,
+bool SkImageFilterUtils::GetInputResultGPU(const SkImageFilter* filter, SkImageFilter::Proxy* proxy,
const SkBitmap& src, const SkMatrix& ctm,
SkBitmap* result, SkIPoint* offset) {
// Ensure that GrContext calls under filterImage and filterImageGPU below will see an identity
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index d3d9093..6b55fdf 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -22,7 +22,7 @@
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;
@@ -305,7 +305,7 @@
bool SkAlphaThresholdFilterImpl::onFilterImage(Proxy*, const SkBitmap& src,
const SkMatrix& matrix, SkBitmap* dst,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkASSERT(src.config() == SkBitmap::kARGB_8888_Config);
if (src.config() != SkBitmap::kARGB_8888_Config) {
diff --git a/src/effects/SkBicubicImageFilter.cpp b/src/effects/SkBicubicImageFilter.cpp
index e44b717..cf71435 100644
--- a/src/effects/SkBicubicImageFilter.cpp
+++ b/src/effects/SkBicubicImageFilter.cpp
@@ -85,7 +85,7 @@
const SkBitmap& source,
const SkMatrix& matrix,
SkBitmap* result,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkBitmap src = source;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, &srcOffset)) {
@@ -170,7 +170,7 @@
#if SK_SUPPORT_GPU
bool SkBicubicImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* offset) {
+ SkBitmap* result, SkIPoint* offset) const {
SkBitmap srcBM;
if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, ctm, &srcBM, offset)) {
return false;
diff --git a/src/effects/SkBitmapSource.cpp b/src/effects/SkBitmapSource.cpp
index f318c91..ec4fcd1 100644
--- a/src/effects/SkBitmapSource.cpp
+++ b/src/effects/SkBitmapSource.cpp
@@ -43,7 +43,7 @@
}
bool SkBitmapSource::onFilterImage(Proxy* proxy, const SkBitmap&, const SkMatrix& matrix,
- SkBitmap* result, SkIPoint* offset) {
+ SkBitmap* result, SkIPoint* offset) const {
SkRect bounds, dstRect;
fBitmap.getBounds(&bounds);
matrix.mapRect(&dstRect, fDstRect);
diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp
index 67b0511..a08b9c5 100644
--- a/src/effects/SkBlurImageFilter.cpp
+++ b/src/effects/SkBlurImageFilter.cpp
@@ -136,7 +136,7 @@
bool SkBlurImageFilter::onFilterImage(Proxy* proxy,
const SkBitmap& source, const SkMatrix& ctm,
- SkBitmap* dst, SkIPoint* offset) {
+ SkBitmap* dst, SkIPoint* offset) const {
SkBitmap src = source;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctm, &src, &srcOffset)) {
@@ -252,7 +252,7 @@
}
bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* offset) {
+ SkBitmap* result, SkIPoint* offset) const {
#if SK_SUPPORT_GPU
SkBitmap input;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp
index da494bb..1f92d16 100755
--- a/src/effects/SkColorFilterImageFilter.cpp
+++ b/src/effects/SkColorFilterImageFilter.cpp
@@ -101,7 +101,7 @@
bool SkColorFilterImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source,
const SkMatrix& matrix,
SkBitmap* result,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkBitmap src = source;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, &srcOffset)) {
diff --git a/src/effects/SkComposeImageFilter.cpp b/src/effects/SkComposeImageFilter.cpp
index cb51376..842ff48 100644
--- a/src/effects/SkComposeImageFilter.cpp
+++ b/src/effects/SkComposeImageFilter.cpp
@@ -17,7 +17,7 @@
const SkBitmap& src,
const SkMatrix& ctm,
SkBitmap* result,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkImageFilter* outer = getInput(0);
SkImageFilter* inner = getInput(1);
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 555f795..a563a6e 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -195,10 +195,10 @@
const SkBitmap& src,
const SkMatrix& ctm,
SkBitmap* dst,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkBitmap displ = src, color = src;
- SkImageFilter* colorInput = getColorInput();
- SkImageFilter* displInput = getDisplacementInput();
+ const SkImageFilter* colorInput = getColorInput();
+ const SkImageFilter* displInput = getDisplacementInput();
SkIPoint colorOffset = SkIPoint::Make(0, 0), displOffset = SkIPoint::Make(0, 0);
if ((colorInput && !colorInput->filterImage(proxy, src, ctm, &color, &colorOffset)) ||
(displInput && !displInput->filterImage(proxy, src, ctm, &displ, &displOffset))) {
@@ -348,7 +348,7 @@
};
bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* offset) {
+ SkBitmap* result, SkIPoint* offset) const {
SkBitmap colorBM;
SkIPoint colorOffset = SkIPoint::Make(0, 0);
if (!SkImageFilterUtils::GetInputResultGPU(getColorInput(), proxy, src, ctm, &colorBM,
diff --git a/src/effects/SkDropShadowImageFilter.cpp b/src/effects/SkDropShadowImageFilter.cpp
index 7cb5152..6d68a24 100644
--- a/src/effects/SkDropShadowImageFilter.cpp
+++ b/src/effects/SkDropShadowImageFilter.cpp
@@ -58,7 +58,7 @@
buffer.writeColor(fColor);
}
-bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source, const SkMatrix& matrix, SkBitmap* result, SkIPoint* offset)
+bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source, const SkMatrix& matrix, SkBitmap* result, SkIPoint* offset) const
{
SkBitmap src = source;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index d16ecb1..f4f1ae1 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -272,7 +272,7 @@
explicit SkDiffuseLightingImageFilter(SkReadBuffer& buffer);
virtual void flatten(SkWriteBuffer& buffer) 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*, const SkMatrix& matrix, const SkIRect& bounds) const SK_OVERRIDE;
#endif
@@ -294,7 +294,7 @@
explicit SkSpecularLightingImageFilter(SkReadBuffer& buffer);
virtual void flatten(SkWriteBuffer& buffer) 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*, const SkMatrix& matrix, const SkIRect& bounds) const SK_OVERRIDE;
#endif
@@ -925,7 +925,7 @@
const SkBitmap& source,
const SkMatrix& ctm,
SkBitmap* dst,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkImageFilter* input = getInput(0);
SkBitmap src = source;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
@@ -1018,7 +1018,7 @@
const SkBitmap& source,
const SkMatrix& ctm,
SkBitmap* dst,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkImageFilter* input = getInput(0);
SkBitmap src = source;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp
index a1c62b7..2fed24d 100644
--- a/src/effects/SkMagnifierImageFilter.cpp
+++ b/src/effects/SkMagnifierImageFilter.cpp
@@ -281,7 +281,7 @@
bool SkMagnifierImageFilter::onFilterImage(Proxy*, const SkBitmap& src,
const SkMatrix&, SkBitmap* dst,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkASSERT(src.config() == SkBitmap::kARGB_8888_Config);
SkASSERT(fSrcRect.width() < src.width());
SkASSERT(fSrcRect.height() < src.height());
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index b73f623..43ebc6c 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -152,7 +152,7 @@
void SkMatrixConvolutionImageFilter::filterPixels(const SkBitmap& src,
SkBitmap* result,
const SkIRect& rect,
- const SkIRect& bounds) {
+ const SkIRect& bounds) const {
for (int y = rect.fTop; y < rect.fBottom; ++y) {
SkPMColor* dptr = result->getAddr32(rect.fLeft - bounds.fLeft, y - bounds.fTop);
for (int x = rect.fLeft; x < rect.fRight; ++x) {
@@ -192,7 +192,7 @@
void SkMatrixConvolutionImageFilter::filterPixels(const SkBitmap& src,
SkBitmap* result,
const SkIRect& rect,
- const SkIRect& bounds) {
+ const SkIRect& bounds) const {
if (fConvolveAlpha) {
filterPixels<PixelFetcher, true>(src, result, rect, bounds);
} else {
@@ -203,14 +203,14 @@
void SkMatrixConvolutionImageFilter::filterInteriorPixels(const SkBitmap& src,
SkBitmap* result,
const SkIRect& rect,
- const SkIRect& bounds) {
+ const SkIRect& bounds) const {
filterPixels<UncheckedPixelFetcher>(src, result, rect, bounds);
}
void SkMatrixConvolutionImageFilter::filterBorderPixels(const SkBitmap& src,
SkBitmap* result,
const SkIRect& rect,
- const SkIRect& bounds) {
+ const SkIRect& bounds) const {
switch (fTileMode) {
case kClamp_TileMode:
filterPixels<ClampPixelFetcher>(src, result, rect, bounds);
@@ -253,7 +253,7 @@
const SkBitmap& source,
const SkMatrix& matrix,
SkBitmap* result,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkBitmap src = source;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, &srcOffset)) {
diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp
index d0a153f..5f66244 100755
--- a/src/effects/SkMergeImageFilter.cpp
+++ b/src/effects/SkMergeImageFilter.cpp
@@ -67,7 +67,7 @@
bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* offset) {
+ SkBitmap* result, SkIPoint* offset) const {
if (countInputs() < 1) {
return false;
}
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 46302ad..f2eeb2d 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -143,7 +143,7 @@
const SkBitmap& source,
const SkMatrix& ctm,
SkBitmap* dst,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkBitmap src = source;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctm, &src, &srcOffset)) {
@@ -214,7 +214,7 @@
bool SkErodeImageFilter::onFilterImage(Proxy* proxy,
const SkBitmap& source, const SkMatrix& ctm,
- SkBitmap* dst, SkIPoint* offset) {
+ SkBitmap* dst, SkIPoint* offset) const {
Proc erodeXProc = SkMorphologyGetPlatformProc(kErodeX_SkMorphologyProcType);
if (!erodeXProc) {
erodeXProc = erode<kX>;
@@ -228,7 +228,7 @@
bool SkDilateImageFilter::onFilterImage(Proxy* proxy,
const SkBitmap& source, const SkMatrix& ctm,
- SkBitmap* dst, SkIPoint* offset) {
+ SkBitmap* dst, SkIPoint* offset) const {
Proc dilateXProc = SkMorphologyGetPlatformProc(kDilateX_SkMorphologyProcType);
if (!dilateXProc) {
dilateXProc = dilate<kX>;
@@ -540,7 +540,7 @@
const SkBitmap& src,
const SkMatrix& ctm,
SkBitmap* result,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkBitmap input;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, ctm, &input, &srcOffset)) {
@@ -582,12 +582,12 @@
}
bool SkDilateImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* offset) {
+ SkBitmap* result, SkIPoint* offset) const {
return this->filterImageGPUGeneric(true, proxy, src, ctm, result, offset);
}
bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* offset) {
+ SkBitmap* result, SkIPoint* offset) const {
return this->filterImageGPUGeneric(false, proxy, src, ctm, result, offset);
}
diff --git a/src/effects/SkOffsetImageFilter.cpp b/src/effects/SkOffsetImageFilter.cpp
index e19a327..b36ef8a 100644
--- a/src/effects/SkOffsetImageFilter.cpp
+++ b/src/effects/SkOffsetImageFilter.cpp
@@ -17,7 +17,7 @@
bool SkOffsetImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source,
const SkMatrix& matrix,
SkBitmap* result,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkImageFilter* input = getInput(0);
SkBitmap src = source;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/SkPictureImageFilter.cpp
index ae95760..c78b249 100644
--- a/src/effects/SkPictureImageFilter.cpp
+++ b/src/effects/SkPictureImageFilter.cpp
@@ -45,7 +45,7 @@
}
bool SkPictureImageFilter::onFilterImage(Proxy* proxy, const SkBitmap&, const SkMatrix& matrix,
- SkBitmap* result, SkIPoint* offset) {
+ SkBitmap* result, SkIPoint* offset) const {
if (!fPicture) {
offset->fX = offset->fY = 0;
return true;
diff --git a/src/effects/SkRectShaderImageFilter.cpp b/src/effects/SkRectShaderImageFilter.cpp
index 272a4af..18e3847 100644
--- a/src/effects/SkRectShaderImageFilter.cpp
+++ b/src/effects/SkRectShaderImageFilter.cpp
@@ -54,7 +54,7 @@
const SkBitmap& source,
const SkMatrix& ctm,
SkBitmap* result,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkIRect bounds;
source.getBounds(&bounds);
if (!this->applyCropRect(&bounds, ctm)) {
diff --git a/src/effects/SkResizeImageFilter.cpp b/src/effects/SkResizeImageFilter.cpp
index 983dd15..4a3f4b5 100644
--- a/src/effects/SkResizeImageFilter.cpp
+++ b/src/effects/SkResizeImageFilter.cpp
@@ -44,7 +44,7 @@
const SkBitmap& source,
const SkMatrix& matrix,
SkBitmap* result,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkBitmap src = source;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, &srcOffset)) {
diff --git a/src/effects/SkTestImageFilters.cpp b/src/effects/SkTestImageFilters.cpp
index 96226f5..6927932 100755
--- a/src/effects/SkTestImageFilters.cpp
+++ b/src/effects/SkTestImageFilters.cpp
@@ -23,7 +23,7 @@
bool SkDownSampleImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
const SkMatrix&,
- SkBitmap* result, SkIPoint*) {
+ SkBitmap* result, SkIPoint*) const {
SkScalar scale = fScale;
if (scale > SK_Scalar1 || scale <= 0) {
return false;
diff --git a/src/effects/SkTileImageFilter.cpp b/src/effects/SkTileImageFilter.cpp
index f0b7fda..f17e2ea 100644
--- a/src/effects/SkTileImageFilter.cpp
+++ b/src/effects/SkTileImageFilter.cpp
@@ -17,7 +17,7 @@
#include "SkValidationUtils.h"
bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
- SkBitmap* dst, SkIPoint* offset) {
+ SkBitmap* dst, SkIPoint* offset) const {
SkBitmap source = src;
SkImageFilter* input = getInput(0);
SkIPoint srcOffset = SkIPoint::Make(0, 0);
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index b3ab9ff..d43699d 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -47,7 +47,7 @@
const SkBitmap& src,
const SkMatrix& ctm,
SkBitmap* dst,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkBitmap background = src, foreground = src;
SkImageFilter* backgroundInput = getInput(0);
SkImageFilter* foregroundInput = getInput(1);
@@ -100,7 +100,7 @@
const SkBitmap& src,
const SkMatrix& ctm,
SkBitmap* result,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkBitmap background;
SkIPoint backgroundOffset = SkIPoint::Make(0, 0);
if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, ctm, &background,
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 8c272f9..a3af3c3 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1515,7 +1515,7 @@
}
static bool filter_texture(SkBaseDevice* device, GrContext* context,
- GrTexture* texture, SkImageFilter* filter,
+ GrTexture* texture, const SkImageFilter* filter,
int w, int h, const SkMatrix& ctm, SkBitmap* result,
SkIPoint* offset) {
SkASSERT(filter);
@@ -1694,11 +1694,11 @@
fContext->drawRectToRect(grPaint, dstRect, srcRect);
}
-bool SkGpuDevice::canHandleImageFilter(SkImageFilter* filter) {
+bool SkGpuDevice::canHandleImageFilter(const SkImageFilter* filter) {
return filter->canFilterImageGPU();
}
-bool SkGpuDevice::filterImage(SkImageFilter* filter, const SkBitmap& src,
+bool SkGpuDevice::filterImage(const SkImageFilter* filter, const SkBitmap& src,
const SkMatrix& ctm,
SkBitmap* result, SkIPoint* offset) {
// want explicitly our impl, so guard against a subclass of us overriding it
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index ff83aad..0f0c38c 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -2330,6 +2330,6 @@
return false;
}
-bool SkPDFDevice::allowImageFilter(SkImageFilter*) {
+bool SkPDFDevice::allowImageFilter(const SkImageFilter*) {
return false;
}
diff --git a/src/utils/SkGatherPixelRefsAndRects.h b/src/utils/SkGatherPixelRefsAndRects.h
index 795378f..5159525 100644
--- a/src/utils/SkGatherPixelRefsAndRects.h
+++ b/src/utils/SkGatherPixelRefsAndRects.h
@@ -299,9 +299,9 @@
}
virtual void lockPixels() SK_OVERRIDE { NothingToDo(); }
virtual void unlockPixels() SK_OVERRIDE { NothingToDo(); }
- virtual bool allowImageFilter(SkImageFilter*) SK_OVERRIDE { return false; }
- virtual bool canHandleImageFilter(SkImageFilter*) SK_OVERRIDE { return false; }
- virtual bool filterImage(SkImageFilter*, const SkBitmap&, const SkMatrix&,
+ virtual bool allowImageFilter(const SkImageFilter*) SK_OVERRIDE { return false; }
+ virtual bool canHandleImageFilter(const SkImageFilter*) SK_OVERRIDE { return false; }
+ virtual bool filterImage(const SkImageFilter*, const SkBitmap&, const SkMatrix&,
SkBitmap* result, SkIPoint* offset) SK_OVERRIDE {
return false;
}
diff --git a/src/utils/SkPictureUtils.cpp b/src/utils/SkPictureUtils.cpp
index 4af8da8..92d0487 100644
--- a/src/utils/SkPictureUtils.cpp
+++ b/src/utils/SkPictureUtils.cpp
@@ -75,9 +75,9 @@
}
virtual void lockPixels() SK_OVERRIDE { nothing_to_do(); }
virtual void unlockPixels() SK_OVERRIDE { nothing_to_do(); }
- virtual bool allowImageFilter(SkImageFilter*) SK_OVERRIDE { return false; }
- virtual bool canHandleImageFilter(SkImageFilter*) SK_OVERRIDE { return false; }
- virtual bool filterImage(SkImageFilter*, const SkBitmap&, const SkMatrix&,
+ virtual bool allowImageFilter(const SkImageFilter*) SK_OVERRIDE { return false; }
+ virtual bool canHandleImageFilter(const SkImageFilter*) SK_OVERRIDE { return false; }
+ virtual bool filterImage(const SkImageFilter*, const SkBitmap&, const SkMatrix&,
SkBitmap* result, SkIPoint* offset) SK_OVERRIDE {
return false;
}