OLD | NEW |
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 "SkMatrixConvolutionImageFilter.h" | 8 #include "SkMatrixConvolutionImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 return result; | 261 return result; |
262 } | 262 } |
263 | 263 |
264 bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy, | 264 bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy, |
265 const SkBitmap& source, | 265 const SkBitmap& source, |
266 const Context& ctx, | 266 const Context& ctx, |
267 SkBitmap* result, | 267 SkBitmap* result, |
268 SkIPoint* offset) const { | 268 SkIPoint* offset) const { |
269 SkBitmap src = source; | 269 SkBitmap src = source; |
270 SkIPoint srcOffset = SkIPoint::Make(0, 0); | 270 SkIPoint srcOffset = SkIPoint::Make(0, 0); |
271 if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctx, &src, &srcO
ffset)) { | 271 if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) { |
272 return false; | 272 return false; |
273 } | 273 } |
274 | 274 |
275 if (src.colorType() != kN32_SkColorType) { | 275 if (src.colorType() != kN32_SkColorType) { |
276 return false; | 276 return false; |
277 } | 277 } |
278 | 278 |
279 SkIRect bounds; | 279 SkIRect bounds; |
280 if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &bounds, &src)) { | 280 if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &bounds, &src)) { |
281 return false; | 281 return false; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]); | 376 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]); |
377 } | 377 } |
378 } | 378 } |
379 str->appendf(")"); | 379 str->appendf(")"); |
380 str->appendf("gain: %f bias: %f ", fGain, fBias); | 380 str->appendf("gain: %f bias: %f ", fGain, fBias); |
381 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY); | 381 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY); |
382 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false"); | 382 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false"); |
383 str->append(")"); | 383 str->append(")"); |
384 } | 384 } |
385 #endif | 385 #endif |
OLD | NEW |