diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-05 22:32:02 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-05 22:32:02 +0000 |
commit | ae761f7545d8ebf181d220169afac2056b057b8c (patch) | |
tree | 73cf6f3c8e384ad332956319046e6536bed97ba4 | |
parent | d2e88f67c9678fbda24ff74039fc1f3aae603e74 (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
54 files changed, 107 insertions, 109 deletions
diff --git a/gm/imagefiltersbase.cpp b/gm/imagefiltersbase.cpp index 109be6a1e0..4794b02699 100644 --- a/gm/imagefiltersbase.cpp +++ b/gm/imagefiltersbase.cpp @@ -23,7 +23,7 @@ public: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(FailImageFilter) protected: virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, - SkBitmap* result, SkIPoint* offset) { + SkBitmap* result, SkIPoint* offset) const { return false; } @@ -46,7 +46,7 @@ public: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(IdentityImageFilter) protected: virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, - SkBitmap* result, SkIPoint* offset) { + SkBitmap* result, SkIPoint* offset) const { *result = src; return true; } diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp index 40b673cb42..6d5105e304 100644 --- a/gm/imagefiltersgraph.cpp +++ b/gm/imagefiltersgraph.cpp @@ -29,7 +29,7 @@ public: : SkImageFilter(input), fDX(dx), fDY(dy) {} virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm, - SkBitmap* dst, SkIPoint* offset) SK_OVERRIDE { + SkBitmap* dst, SkIPoint* offset) const SK_OVERRIDE { SkBitmap source = src; SkImageFilter* input = getInput(0); SkIPoint srcOffset = SkIPoint::Make(0, 0); diff --git a/include/core/SkBitmapDevice.h b/include/core/SkBitmapDevice.h index 945ffbfca4..e4f9b88a5e 100644 --- a/include/core/SkBitmapDevice.h +++ b/include/core/SkBitmapDevice.h @@ -227,7 +227,7 @@ protected: * some subclasses that do not support pixel manipulations after drawing * has occurred (e.g. printing). The default implementation returns true. */ - virtual bool allowImageFilter(SkImageFilter*) SK_OVERRIDE; + virtual bool allowImageFilter(const SkImageFilter*) SK_OVERRIDE; /** * Override and return true for filters that the device can handle @@ -236,7 +236,7 @@ protected: * Returning false means the SkCanvas will have apply the filter itself, * and just pass the resulting image to the device. */ - virtual bool canHandleImageFilter(SkImageFilter*) SK_OVERRIDE; + virtual bool canHandleImageFilter(const SkImageFilter*) SK_OVERRIDE; /** * Related (but not required) to canHandleImageFilter, this method returns @@ -245,7 +245,7 @@ protected: * If the device does not recognize or support this filter, * it just returns false and leaves result and offset unchanged. */ - virtual bool filterImage(SkImageFilter*, const SkBitmap&, const SkMatrix&, + virtual bool filterImage(const SkImageFilter*, const SkBitmap&, const SkMatrix&, SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; private: diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h index 7c83f448d4..016e2babc8 100644 --- a/include/core/SkDevice.h +++ b/include/core/SkDevice.h @@ -341,7 +341,7 @@ protected: * some subclasses that do not support pixel manipulations after drawing * has occurred (e.g. printing). The default implementation returns true. */ - virtual bool allowImageFilter(SkImageFilter*) = 0; + virtual bool allowImageFilter(const SkImageFilter*) = 0; /** * Override and return true for filters that the device can handle @@ -350,7 +350,7 @@ protected: * Returning false means the SkCanvas will have apply the filter itself, * and just pass the resulting image to the device. */ - virtual bool canHandleImageFilter(SkImageFilter*) = 0; + virtual bool canHandleImageFilter(const SkImageFilter*) = 0; /** * Related (but not required) to canHandleImageFilter, this method returns @@ -359,7 +359,7 @@ protected: * If the device does not recognize or support this filter, * it just returns false and leaves result and offset unchanged. */ - virtual bool filterImage(SkImageFilter*, const SkBitmap&, const SkMatrix&, + virtual bool filterImage(const SkImageFilter*, const SkBitmap&, const SkMatrix&, SkBitmap* result, SkIPoint* offset) = 0; // This is equal kBGRA_Premul_Config8888 or kRGBA_Premul_Config8888 if diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h index 6b53987891..a3e5a62ee5 100644 --- a/include/core/SkImageFilter.h +++ b/include/core/SkImageFilter.h @@ -55,10 +55,10 @@ public: virtual SkBaseDevice* createDevice(int width, int height) = 0; // returns true if the proxy can handle this filter natively - virtual bool canHandleImageFilter(SkImageFilter*) = 0; + virtual bool canHandleImageFilter(const SkImageFilter*) = 0; // returns true if the proxy handled the filter itself. if this returns // false then the filter's code will be called. - virtual bool filterImage(SkImageFilter*, const SkBitmap& src, + virtual bool filterImage(const SkImageFilter*, const SkBitmap& src, const SkMatrix& ctm, SkBitmap* result, SkIPoint* offset) = 0; }; @@ -77,7 +77,7 @@ public: * the result and offset parameters will be ignored by the caller. */ bool filterImage(Proxy*, const SkBitmap& src, const SkMatrix& ctm, - SkBitmap* result, SkIPoint* offset); + SkBitmap* result, SkIPoint* offset) const; /** * Given the src bounds of an image, this returns the bounds of the result @@ -105,7 +105,7 @@ public: * single-pass processing using asNewEffect(). */ virtual bool filterImageGPU(Proxy*, const SkBitmap& src, const SkMatrix& ctm, - SkBitmap* result, SkIPoint* offset); + SkBitmap* result, SkIPoint* offset) const; /** * Returns whether this image filter is a color filter and puts the color filter into the @@ -187,7 +187,7 @@ protected: * caller. */ virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, - SkBitmap* result, SkIPoint* offset); + SkBitmap* result, SkIPoint* offset) const; // Given the bounds of the destination rect to be filled in device // coordinates (first parameter), and the CTM, compute (conservatively) // which rect of the source image would be required (third parameter). diff --git a/include/core/SkImageFilterUtils.h b/include/core/SkImageFilterUtils.h index b3921cdaf6..b533c3bca2 100644 --- a/include/core/SkImageFilterUtils.h +++ b/include/core/SkImageFilterUtils.h @@ -28,7 +28,7 @@ public: * this function returns src. If the filter has no GPU implementation, it * will be processed in software and uploaded to the GPU. */ - static bool GetInputResultGPU(SkImageFilter* filter, SkImageFilter::Proxy* proxy, + static bool GetInputResultGPU(const SkImageFilter* filter, SkImageFilter::Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm, SkBitmap* result, SkIPoint* offset); }; 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: diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h index 151a6dcd65..8b2170da6d 100644 --- a/include/gpu/SkGpuDevice.h +++ b/include/gpu/SkGpuDevice.h @@ -131,8 +131,8 @@ public: */ virtual void makeRenderTargetCurrent(); - virtual bool canHandleImageFilter(SkImageFilter*) SK_OVERRIDE; - virtual bool filterImage(SkImageFilter*, const SkBitmap&, const SkMatrix&, + virtual bool canHandleImageFilter(const SkImageFilter*) SK_OVERRIDE; + virtual bool filterImage(const SkImageFilter*, const SkBitmap&, const SkMatrix&, SkBitmap*, SkIPoint*) SK_OVERRIDE; class SkAutoCachedTexture; // used internally diff --git a/include/pdf/SkPDFDevice.h b/include/pdf/SkPDFDevice.h index 51d046de60..9b21f8f90a 100644 --- a/include/pdf/SkPDFDevice.h +++ b/include/pdf/SkPDFDevice.h @@ -213,7 +213,7 @@ protected: virtual bool onReadPixels(const SkBitmap& bitmap, int x, int y, SkCanvas::Config8888) SK_OVERRIDE; - virtual bool allowImageFilter(SkImageFilter*) SK_OVERRIDE; + virtual bool allowImageFilter(const SkImageFilter*) SK_OVERRIDE; private: // TODO(vandebo): push most of SkPDFDevice's state into a core object in diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp index 5e70b1ab1b..9dde6e172e 100644 --- a/src/core/SkBitmapDevice.cpp +++ b/src/core/SkBitmapDevice.cpp @@ -95,17 +95,17 @@ const SkBitmap& SkBitmapDevice::onAccessBitmap() { 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 03fcb68125..800e42c1f6 100644 --- a/src/core/SkDeviceImageFilterProxy.h +++ b/src/core/SkDeviceImageFilterProxy.h @@ -18,10 +18,10 @@ public: 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 384f2dce6b..cd7c01b4e6 100644 --- a/src/core/SkImageFilter.cpp +++ b/src/core/SkImageFilter.cpp @@ -94,7 +94,7 @@ void SkImageFilter::flatten(SkWriteBuffer& buffer) const { 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 @@ void SkImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const { } bool SkImageFilter::onFilterImage(Proxy*, const SkBitmap&, const SkMatrix&, - SkBitmap*, SkIPoint*) { + SkBitmap*, SkIPoint*) const { return false; } @@ -144,7 +144,7 @@ bool SkImageFilter::canFilterImageGPU() const { } 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 204f38d65b..c6c534e71d 100644 --- a/src/core/SkImageFilterUtils.cpp +++ b/src/core/SkImageFilterUtils.cpp @@ -21,7 +21,7 @@ bool SkImageFilterUtils::WrapTexture(GrTexture* texture, int width, int height, 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 d3d9093050..6b55fdf90e 100644 --- a/src/effects/SkAlphaThresholdFilter.cpp +++ b/src/effects/SkAlphaThresholdFilter.cpp @@ -22,7 +22,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; @@ -305,7 +305,7 @@ void SkAlphaThresholdFilterImpl::flatten(SkWriteBuffer& buffer) const { 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 e44b717003..cf71435cde 100644 --- a/src/effects/SkBicubicImageFilter.cpp +++ b/src/effects/SkBicubicImageFilter.cpp @@ -85,7 +85,7 @@ bool SkBicubicImageFilter::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)) { @@ -170,7 +170,7 @@ bool SkBicubicImageFilter::onFilterImage(Proxy* proxy, #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 f318c91a73..ec4fcd16fb 100644 --- a/src/effects/SkBitmapSource.cpp +++ b/src/effects/SkBitmapSource.cpp @@ -43,7 +43,7 @@ void SkBitmapSource::flatten(SkWriteBuffer& buffer) const { } 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 67b0511480..a08b9c5675 100644 --- a/src/effects/SkBlurImageFilter.cpp +++ b/src/effects/SkBlurImageFilter.cpp @@ -136,7 +136,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* 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::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, } 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 da494bb294..1f92d1683d 100755 --- a/src/effects/SkColorFilterImageFilter.cpp +++ b/src/effects/SkColorFilterImageFilter.cpp @@ -101,7 +101,7 @@ SkColorFilterImageFilter::~SkColorFilterImageFilter() { 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 cb513766cc..842ff48b82 100644 --- a/src/effects/SkComposeImageFilter.cpp +++ b/src/effects/SkComposeImageFilter.cpp @@ -17,7 +17,7 @@ bool SkComposeImageFilter::onFilterImage(Proxy* proxy, 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 555f795a51..a563a6ef85 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -195,10 +195,10 @@ bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy, 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 @@ private: }; 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 7cb515265c..6d68a24d43 100644 --- a/src/effects/SkDropShadowImageFilter.cpp +++ b/src/effects/SkDropShadowImageFilter.cpp @@ -58,7 +58,7 @@ void SkDropShadowImageFilter::flatten(SkWriteBuffer& buffer) const 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 d16ecb1bb3..f4f1ae1707 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -272,7 +272,7 @@ protected: 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 @@ protected: 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 @@ bool SkDiffuseLightingImageFilter::onFilterImage(Proxy* proxy, 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 @@ bool SkSpecularLightingImageFilter::onFilterImage(Proxy* proxy, 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 a1c62b7720..2fed24dc74 100644 --- a/src/effects/SkMagnifierImageFilter.cpp +++ b/src/effects/SkMagnifierImageFilter.cpp @@ -281,7 +281,7 @@ void SkMagnifierImageFilter::flatten(SkWriteBuffer& buffer) const { 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 b73f623aec..43ebc6ce66 100644 --- a/src/effects/SkMatrixConvolutionImageFilter.cpp +++ b/src/effects/SkMatrixConvolutionImageFilter.cpp @@ -152,7 +152,7 @@ template<class PixelFetcher, bool convolveAlpha> 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 @@ template<class PixelFetcher> 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::filterPixels(const SkBitmap& src, 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 @@ bool SkMatrixConvolutionImageFilter::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/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp index d0a153fa50..5f66244084 100755 --- a/src/effects/SkMergeImageFilter.cpp +++ b/src/effects/SkMergeImageFilter.cpp @@ -67,7 +67,7 @@ SkMergeImageFilter::~SkMergeImageFilter() { 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 46302ad520..f2eeb2d6ff 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -143,7 +143,7 @@ bool SkMorphologyImageFilter::filterImageGeneric(SkMorphologyImageFilter::Proc p 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 SkMorphologyImageFilter::filterImageGeneric(SkMorphologyImageFilter::Proc p 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 SkErodeImageFilter::onFilterImage(Proxy* proxy, 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 @@ bool SkMorphologyImageFilter::filterImageGPUGeneric(bool dilate, 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 SkMorphologyImageFilter::filterImageGPUGeneric(bool dilate, } 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 e19a3275d1..b36ef8a3ed 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 ae9576043f..c78b2499ec 100644 --- a/src/effects/SkPictureImageFilter.cpp +++ b/src/effects/SkPictureImageFilter.cpp @@ -45,7 +45,7 @@ void SkPictureImageFilter::flatten(SkWriteBuffer& buffer) const { } 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 272a4af2b9..18e38470bc 100644 --- a/src/effects/SkRectShaderImageFilter.cpp +++ b/src/effects/SkRectShaderImageFilter.cpp @@ -54,7 +54,7 @@ bool SkRectShaderImageFilter::onFilterImage(Proxy* proxy, 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 983dd157cc..4a3f4b56ee 100644 --- a/src/effects/SkResizeImageFilter.cpp +++ b/src/effects/SkResizeImageFilter.cpp @@ -44,7 +44,7 @@ bool SkResizeImageFilter::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/SkTestImageFilters.cpp b/src/effects/SkTestImageFilters.cpp index 96226f5d25..69279324ca 100755 --- a/src/effects/SkTestImageFilters.cpp +++ b/src/effects/SkTestImageFilters.cpp @@ -23,7 +23,7 @@ public: 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 f0b7fda869..f17e2eac93 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 b3ab9ffa93..d43699db64 100644 --- a/src/effects/SkXfermodeImageFilter.cpp +++ b/src/effects/SkXfermodeImageFilter.cpp @@ -47,7 +47,7 @@ bool SkXfermodeImageFilter::onFilterImage(Proxy* proxy, 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 @@ bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy, 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 8c272f947a..a3af3c3d08 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1515,7 +1515,7 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap, } 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 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device, 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 ff83aadeee..0f0c38c0b1 100644 --- a/src/pdf/SkPDFDevice.cpp +++ b/src/pdf/SkPDFDevice.cpp @@ -2330,6 +2330,6 @@ bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, 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 795378f3e5..5159525939 100644 --- a/src/utils/SkGatherPixelRefsAndRects.h +++ b/src/utils/SkGatherPixelRefsAndRects.h @@ -299,9 +299,9 @@ protected: } 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 4af8da8ecf..92d0487c54 100644 --- a/src/utils/SkPictureUtils.cpp +++ b/src/utils/SkPictureUtils.cpp @@ -75,9 +75,9 @@ public: } 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; } |