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/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)) {