Image Filters: refactor all CPU input processing into a filterInput helper function.
No change in behaviour; this is a straight refactoring.
BUG=skia:3194
Review URL: https://codereview.chromium.org/1404743005
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index ca11c38..5de945f 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -212,11 +212,9 @@
SkBitmap* dst,
SkIPoint* offset) const {
SkBitmap displ = src, color = src;
- const SkImageFilter* colorInput = this->getColorInput();
- const SkImageFilter* displInput = this->getDisplacementInput();
SkIPoint colorOffset = SkIPoint::Make(0, 0), displOffset = SkIPoint::Make(0, 0);
- if ((colorInput && !colorInput->filterImage(proxy, src, ctx, &color, &colorOffset)) ||
- (displInput && !displInput->filterImage(proxy, src, ctx, &displ, &displOffset))) {
+ if (!this->filterInput(1, proxy, src, ctx, &color, &colorOffset) ||
+ !this->filterInput(0, proxy, src, ctx, &displ, &displOffset)) {
return false;
}
if ((displ.colorType() != kN32_SkColorType) ||