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

Side by Side Diff: src/effects/SkMatrixConvolutionImageFilter.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/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.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 2012 The Android Open Source Project 2 * Copyright 2012 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 "SkMatrixConvolutionImageFilter.h" 8 #include "SkMatrixConvolutionImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 return result; 261 return result;
262 } 262 }
263 263
264 bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy, 264 bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy,
265 const SkBitmap& source, 265 const SkBitmap& source,
266 const Context& ctx, 266 const Context& ctx,
267 SkBitmap* result, 267 SkBitmap* result,
268 SkIPoint* offset) const { 268 SkIPoint* offset) const {
269 SkBitmap src = source; 269 SkBitmap src = source;
270 SkIPoint srcOffset = SkIPoint::Make(0, 0); 270 SkIPoint srcOffset = SkIPoint::Make(0, 0);
271 if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctx, &src, &srcO ffset)) { 271 if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) {
272 return false; 272 return false;
273 } 273 }
274 274
275 if (src.colorType() != kN32_SkColorType) { 275 if (src.colorType() != kN32_SkColorType) {
276 return false; 276 return false;
277 } 277 }
278 278
279 SkIRect bounds; 279 SkIRect bounds;
280 if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &bounds, &src)) { 280 if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &bounds, &src)) {
281 return false; 281 return false;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]); 376 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]);
377 } 377 }
378 } 378 }
379 str->appendf(")"); 379 str->appendf(")");
380 str->appendf("gain: %f bias: %f ", fGain, fBias); 380 str->appendf("gain: %f bias: %f ", fGain, fBias);
381 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY); 381 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY);
382 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false"); 382 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false");
383 str->append(")"); 383 str->append(")");
384 } 384 }
385 #endif 385 #endif
OLDNEW
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698