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

Side by Side Diff: src/effects/SkMorphologyImageFilter.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/SkMergeImageFilter.cpp ('k') | src/effects/SkOffsetImageFilter.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 "SkMorphologyImageFilter.h" 8 #include "SkMorphologyImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 bool SkMorphologyImageFilter::filterImageGeneric(SkMorphologyImageFilter::Proc p rocX, 52 bool SkMorphologyImageFilter::filterImageGeneric(SkMorphologyImageFilter::Proc p rocX,
53 SkMorphologyImageFilter::Proc p rocY, 53 SkMorphologyImageFilter::Proc p rocY,
54 Proxy* proxy, 54 Proxy* proxy,
55 const SkBitmap& source, 55 const SkBitmap& source,
56 const Context& ctx, 56 const Context& ctx,
57 SkBitmap* dst, 57 SkBitmap* dst,
58 SkIPoint* offset) const { 58 SkIPoint* offset) const {
59 SkBitmap src = source; 59 SkBitmap src = source;
60 SkIPoint srcOffset = SkIPoint::Make(0, 0); 60 SkIPoint srcOffset = SkIPoint::Make(0, 0);
61 if (this->getInput(0) && 61 if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) {
62 !this->getInput(0)->filterImage(proxy, source, ctx, &src, &srcOffset)) {
63 return false; 62 return false;
64 } 63 }
65 64
66 if (src.colorType() != kN32_SkColorType) { 65 if (src.colorType() != kN32_SkColorType) {
67 return false; 66 return false;
68 } 67 }
69 68
70 SkIRect bounds; 69 SkIRect bounds;
71 if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &bounds, &src)) { 70 if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &bounds, &src)) {
72 return false; 71 return false;
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 SkBitmap* result, SkIPoint* offset) con st { 656 SkBitmap* result, SkIPoint* offset) con st {
658 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); 657 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset);
659 } 658 }
660 659
661 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, 660 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
662 SkBitmap* result, SkIPoint* offset) cons t { 661 SkBitmap* result, SkIPoint* offset) cons t {
663 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); 662 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset);
664 } 663 }
665 664
666 #endif 665 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMergeImageFilter.cpp ('k') | src/effects/SkOffsetImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698