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

Side by Side Diff: src/effects/SkComposeImageFilter.cpp

Issue 1612953004: Image filters: Make a recursive, forward-mapping bounds traversal. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT Created 4 years, 10 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/SkLocalMatrixImageFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkComposeImageFilter.h" 9 #include "SkComposeImageFilter.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 30 matching lines...) Expand all
41 if (!this->filterInput(0, proxy, tmp, outerContext, result, &outerOffset)) { 41 if (!this->filterInput(0, proxy, tmp, outerContext, result, &outerOffset)) {
42 return false; 42 return false;
43 } 43 }
44 44
45 *offset = innerOffset + outerOffset; 45 *offset = innerOffset + outerOffset;
46 return true; 46 return true;
47 } 47 }
48 48
49 bool SkComposeImageFilter::onFilterBounds(const SkIRect& src, 49 bool SkComposeImageFilter::onFilterBounds(const SkIRect& src,
50 const SkMatrix& ctm, 50 const SkMatrix& ctm,
51 SkIRect* dst) const { 51 SkIRect* dst,
52 MapDirection direction) const {
52 SkImageFilter* outer = getInput(0); 53 SkImageFilter* outer = getInput(0);
53 SkImageFilter* inner = getInput(1); 54 SkImageFilter* inner = getInput(1);
54 55
55 SkIRect tmp; 56 SkIRect tmp;
56 return inner->filterBounds(src, ctm, &tmp) && outer->filterBounds(tmp, ctm, dst); 57 return inner->filterBounds(src, ctm, &tmp, direction) &&
58 outer->filterBounds(tmp, ctm, dst, direction);
57 } 59 }
58 60
59 SkFlattenable* SkComposeImageFilter::CreateProc(SkReadBuffer& buffer) { 61 SkFlattenable* SkComposeImageFilter::CreateProc(SkReadBuffer& buffer) {
60 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 2); 62 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 2);
61 return SkComposeImageFilter::Create(common.getInput(0), common.getInput(1)); 63 return SkComposeImageFilter::Create(common.getInput(0), common.getInput(1));
62 } 64 }
63 65
64 #ifndef SK_IGNORE_TO_STRING 66 #ifndef SK_IGNORE_TO_STRING
65 void SkComposeImageFilter::toString(SkString* str) const { 67 void SkComposeImageFilter::toString(SkString* str) const {
66 SkImageFilter* outer = getInput(0); 68 SkImageFilter* outer = getInput(0);
67 SkImageFilter* inner = getInput(1); 69 SkImageFilter* inner = getInput(1);
68 70
69 str->appendf("SkComposeImageFilter: ("); 71 str->appendf("SkComposeImageFilter: (");
70 72
71 str->appendf("outer: "); 73 str->appendf("outer: ");
72 outer->toString(str); 74 outer->toString(str);
73 75
74 str->appendf("inner: "); 76 str->appendf("inner: ");
75 inner->toString(str); 77 inner->toString(str);
76 78
77 str->appendf(")"); 79 str->appendf(")");
78 } 80 }
79 #endif 81 #endif
OLDNEW
« no previous file with comments | « src/core/SkLocalMatrixImageFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698