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

Side by Side Diff: src/effects/SkTileImageFilter.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/SkOffsetImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 "SkTileImageFilter.h" 8 #include "SkTileImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 10 matching lines...) Expand all
21 if (!SkIsValidRect(srcRect) || !SkIsValidRect(dstRect)) { 21 if (!SkIsValidRect(srcRect) || !SkIsValidRect(dstRect)) {
22 return nullptr; 22 return nullptr;
23 } 23 }
24 return new SkTileImageFilter(srcRect, dstRect, input); 24 return new SkTileImageFilter(srcRect, dstRect, input);
25 } 25 }
26 26
27 bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, 27 bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
28 const Context& ctx, 28 const Context& ctx,
29 SkBitmap* dst, SkIPoint* offset) const { 29 SkBitmap* dst, SkIPoint* offset) const {
30 SkBitmap source = src; 30 SkBitmap source = src;
31 SkImageFilter* input = getInput(0);
32 SkIPoint srcOffset = SkIPoint::Make(0, 0); 31 SkIPoint srcOffset = SkIPoint::Make(0, 0);
33 if (input && !input->filterImage(proxy, src, ctx, &source, &srcOffset)) { 32 if (!this->filterInput(0, proxy, src, ctx, &source, &srcOffset)) {
34 return false; 33 return false;
35 } 34 }
36 35
37 SkRect dstRect; 36 SkRect dstRect;
38 ctx.ctm().mapRect(&dstRect, fDstRect); 37 ctx.ctm().mapRect(&dstRect, fDstRect);
39 const SkIRect dstIRect = dstRect.roundOut(); 38 const SkIRect dstIRect = dstRect.roundOut();
40 int w = dstIRect.width(); 39 int w = dstIRect.width();
41 int h = dstIRect.height(); 40 int h = dstIRect.height();
42 if (!fSrcRect.width() || !fSrcRect.height() || !w || !h) { 41 if (!fSrcRect.width() || !fSrcRect.height() || !w || !h) {
43 return false; 42 return false;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 str->appendf(" dst: %.2f %.2f %.2f %.2f", 120 str->appendf(" dst: %.2f %.2f %.2f %.2f",
122 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto m); 121 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto m);
123 if (this->getInput(0)) { 122 if (this->getInput(0)) {
124 str->appendf("input: ("); 123 str->appendf("input: (");
125 this->getInput(0)->toString(str); 124 this->getInput(0)->toString(str);
126 str->appendf(")"); 125 str->appendf(")");
127 } 126 }
128 str->append(")"); 127 str->append(")");
129 } 128 }
130 #endif 129 #endif
OLDNEW
« no previous file with comments | « src/effects/SkOffsetImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698