| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 SkIPoint srcOffset = SkIPoint::Make(0, 0); | 258 SkIPoint srcOffset = SkIPoint::Make(0, 0); |
| 259 if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctx, &src, &srcO
ffset)) { | 259 if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctx, &src, &srcO
ffset)) { |
| 260 return false; | 260 return false; |
| 261 } | 261 } |
| 262 | 262 |
| 263 if (src.colorType() != kPMColor_SkColorType) { | 263 if (src.colorType() != kPMColor_SkColorType) { |
| 264 return false; | 264 return false; |
| 265 } | 265 } |
| 266 | 266 |
| 267 SkIRect bounds; | 267 SkIRect bounds; |
| 268 if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &bounds, &src)) { | 268 src.getBounds(&bounds); |
| 269 bounds.offset(srcOffset); |
| 270 if (!this->applyCropRect(&bounds, ctx.ctm())) { |
| 269 return false; | 271 return false; |
| 270 } | 272 } |
| 271 | 273 |
| 272 if (!fConvolveAlpha && !src.isOpaque()) { | 274 if (!fConvolveAlpha && !src.isOpaque()) { |
| 273 src = unpremultiplyBitmap(src); | 275 src = unpremultiplyBitmap(src); |
| 274 } | 276 } |
| 275 | 277 |
| 276 SkAutoLockPixels alp(src); | 278 SkAutoLockPixels alp(src); |
| 277 if (!src.getPixels()) { | 279 if (!src.getPixels()) { |
| 278 return false; | 280 return false; |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 fBias, | 664 fBias, |
| 663 fKernelOffset, | 665 fKernelOffset, |
| 664 fTileMode, | 666 fTileMode, |
| 665 fConvolveAlpha); | 667 fConvolveAlpha); |
| 666 return true; | 668 return true; |
| 667 } | 669 } |
| 668 | 670 |
| 669 /////////////////////////////////////////////////////////////////////////////// | 671 /////////////////////////////////////////////////////////////////////////////// |
| 670 | 672 |
| 671 #endif | 673 #endif |
| OLD | NEW |