| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 196 } |
| 197 } | 197 } |
| 198 return result; | 198 return result; |
| 199 } | 199 } |
| 200 | 200 |
| 201 bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy, | 201 bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy, |
| 202 const SkBitmap& source, | 202 const SkBitmap& source, |
| 203 const SkMatrix& matrix, | 203 const SkMatrix& matrix, |
| 204 SkBitmap* result, | 204 SkBitmap* result, |
| 205 SkIPoint* loc) { | 205 SkIPoint* loc) { |
| 206 SkBitmap src = this->getInputResult(0, proxy, source, matrix, loc); | 206 SkBitmap src = source; |
| 207 if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, lo
c)) { |
| 208 return false; |
| 209 } |
| 210 |
| 207 if (src.config() != SkBitmap::kARGB_8888_Config) { | 211 if (src.config() != SkBitmap::kARGB_8888_Config) { |
| 208 return false; | 212 return false; |
| 209 } | 213 } |
| 210 | 214 |
| 211 if (!fConvolveAlpha && !src.isOpaque()) { | 215 if (!fConvolveAlpha && !src.isOpaque()) { |
| 212 src = unpremultiplyBitmap(src); | 216 src = unpremultiplyBitmap(src); |
| 213 } | 217 } |
| 214 | 218 |
| 215 SkAutoLockPixels alp(src); | 219 SkAutoLockPixels alp(src); |
| 216 if (!src.getPixels()) { | 220 if (!src.getPixels()) { |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 fBias, | 577 fBias, |
| 574 fTarget, | 578 fTarget, |
| 575 fTileMode, | 579 fTileMode, |
| 576 fConvolveAlpha); | 580 fConvolveAlpha); |
| 577 return true; | 581 return true; |
| 578 } | 582 } |
| 579 | 583 |
| 580 /////////////////////////////////////////////////////////////////////////////// | 584 /////////////////////////////////////////////////////////////////////////////// |
| 581 | 585 |
| 582 #endif | 586 #endif |
| OLD | NEW |