Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Unified Diff: src/effects/SkMergeImageFilter.cpp

Issue 1404743005: Image Filters: refactor all CPU input processing into a filterInput helper function. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Tweak comment Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMergeImageFilter.cpp
diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp
index 6e06b25945a84d73795d76a085d371a8cc9a5b72..e99991898c288a167d97b917da87c673ec687c40 100755
--- a/src/effects/SkMergeImageFilter.cpp
+++ b/src/effects/SkMergeImageFilter.cpp
@@ -81,24 +81,17 @@ bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
int inputCount = countInputs();
for (int i = 0; i < inputCount; ++i) {
SkBitmap tmp;
- const SkBitmap* srcPtr;
+ SkBitmap input = src;
SkIPoint pos = SkIPoint::Make(0, 0);
- SkImageFilter* filter = getInput(i);
- if (filter) {
- if (!filter->filterImage(proxy, src, ctx, &tmp, &pos)) {
- continue;
- }
- srcPtr = &tmp;
- } else {
- srcPtr = &src;
+ if (!this->filterInput(i, proxy, src, ctx, &input, &pos)) {
+ continue;
}
-
if (fModes) {
paint.setXfermodeMode((SkXfermode::Mode)fModes[i]);
} else {
paint.setXfermode(nullptr);
}
- canvas.drawSprite(*srcPtr, pos.x() - x0, pos.y() - y0, &paint);
+ canvas.drawSprite(input, pos.x() - x0, pos.y() - y0, &paint);
didProduceResult = true;
}
« no previous file with comments | « src/effects/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698