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

Side by Side Diff: src/effects/SkBlurImageFilter.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 unified diff | Download patch
« no previous file with comments | « src/core/SkMatrixImageFilter.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The Android Open Source Project 2 * Copyright 2011 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 *lowOffset = *highOffset - 1; 65 *lowOffset = *highOffset - 1;
66 *kernelSize3 = d + 1; 66 *kernelSize3 = d + 1;
67 } 67 }
68 } 68 }
69 69
70 bool SkBlurImageFilter::onFilterImage(Proxy* proxy, 70 bool SkBlurImageFilter::onFilterImage(Proxy* proxy,
71 const SkBitmap& source, const Context& ctx , 71 const SkBitmap& source, const Context& ctx ,
72 SkBitmap* dst, SkIPoint* offset) const { 72 SkBitmap* dst, SkIPoint* offset) const {
73 SkBitmap src = source; 73 SkBitmap src = source;
74 SkIPoint srcOffset = SkIPoint::Make(0, 0); 74 SkIPoint srcOffset = SkIPoint::Make(0, 0);
75 if (this->getInput(0) && 75 if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) {
76 !this->getInput(0)->filterImage(proxy, source, ctx, &src, &srcOffset)) {
77 return false; 76 return false;
78 } 77 }
79 78
80 if (src.colorType() != kN32_SkColorType) { 79 if (src.colorType() != kN32_SkColorType) {
81 return false; 80 return false;
82 } 81 }
83 82
84 SkIRect srcBounds, dstBounds; 83 SkIRect srcBounds, dstBounds;
85 if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &srcBounds, &src)) { 84 if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &srcBounds, &src)) {
86 return false; 85 return false;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 str->appendf("SkBlurImageFilter: ("); 230 str->appendf("SkBlurImageFilter: (");
232 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); 231 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight);
233 232
234 if (this->getInput(0)) { 233 if (this->getInput(0)) {
235 this->getInput(0)->toString(str); 234 this->getInput(0)->toString(str);
236 } 235 }
237 236
238 str->append("))"); 237 str->append("))");
239 } 238 }
240 #endif 239 #endif
OLDNEW
« no previous file with comments | « src/core/SkMatrixImageFilter.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698