OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The Android Open Source Project | 2 * Copyright 2011 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 *lowOffset = *highOffset - 1; | 65 *lowOffset = *highOffset - 1; |
66 *kernelSize3 = d + 1; | 66 *kernelSize3 = d + 1; |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 bool SkBlurImageFilter::onFilterImage(Proxy* proxy, | 70 bool SkBlurImageFilter::onFilterImage(Proxy* proxy, |
71 const SkBitmap& source, const Context& ctx
, | 71 const SkBitmap& source, const Context& ctx
, |
72 SkBitmap* dst, SkIPoint* offset) const { | 72 SkBitmap* dst, SkIPoint* offset) const { |
73 SkBitmap src = source; | 73 SkBitmap src = source; |
74 SkIPoint srcOffset = SkIPoint::Make(0, 0); | 74 SkIPoint srcOffset = SkIPoint::Make(0, 0); |
75 if (this->getInput(0) && | 75 if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) { |
76 !this->getInput(0)->filterImage(proxy, source, ctx, &src, &srcOffset)) { | |
77 return false; | 76 return false; |
78 } | 77 } |
79 | 78 |
80 if (src.colorType() != kN32_SkColorType) { | 79 if (src.colorType() != kN32_SkColorType) { |
81 return false; | 80 return false; |
82 } | 81 } |
83 | 82 |
84 SkIRect srcBounds, dstBounds; | 83 SkIRect srcBounds, dstBounds; |
85 if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &srcBounds, &src)) { | 84 if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &srcBounds, &src)) { |
86 return false; | 85 return false; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 str->appendf("SkBlurImageFilter: ("); | 230 str->appendf("SkBlurImageFilter: ("); |
232 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); | 231 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); |
233 | 232 |
234 if (this->getInput(0)) { | 233 if (this->getInput(0)) { |
235 this->getInput(0)->toString(str); | 234 this->getInput(0)->toString(str); |
236 } | 235 } |
237 | 236 |
238 str->append("))"); | 237 str->append("))"); |
239 } | 238 } |
240 #endif | 239 #endif |
OLD | NEW |