OLD | NEW |
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 Loading... |
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 |
OLD | NEW |