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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 src = unpremultiplyBitmap(src); | 272 src = unpremultiplyBitmap(src); |
273 } | 273 } |
274 | 274 |
275 SkAutoLockPixels alp(src); | 275 SkAutoLockPixels alp(src); |
276 if (!src.getPixels()) { | 276 if (!src.getPixels()) { |
277 return false; | 277 return false; |
278 } | 278 } |
279 | 279 |
280 result->setConfig(src.config(), bounds.width(), bounds.height()); | 280 result->setConfig(src.config(), bounds.width(), bounds.height()); |
281 result->allocPixels(); | 281 result->allocPixels(); |
| 282 if (!result->getPixels()) { |
| 283 return false; |
| 284 } |
282 | 285 |
283 SkIRect interior = SkIRect::MakeXYWH(bounds.left() + fTarget.fX, | 286 SkIRect interior = SkIRect::MakeXYWH(bounds.left() + fTarget.fX, |
284 bounds.top() + fTarget.fY, | 287 bounds.top() + fTarget.fY, |
285 bounds.width() - fKernelSize.fWidth + 1
, | 288 bounds.width() - fKernelSize.fWidth + 1
, |
286 bounds.height() - fKernelSize.fHeight +
1); | 289 bounds.height() - fKernelSize.fHeight +
1); |
287 SkIRect top = SkIRect::MakeLTRB(bounds.left(), bounds.top(), bounds.right(),
interior.top()); | 290 SkIRect top = SkIRect::MakeLTRB(bounds.left(), bounds.top(), bounds.right(),
interior.top()); |
288 SkIRect bottom = SkIRect::MakeLTRB(bounds.left(), interior.bottom(), | 291 SkIRect bottom = SkIRect::MakeLTRB(bounds.left(), interior.bottom(), |
289 bounds.right(), bounds.bottom()); | 292 bounds.right(), bounds.bottom()); |
290 SkIRect left = SkIRect::MakeLTRB(bounds.left(), interior.top(), | 293 SkIRect left = SkIRect::MakeLTRB(bounds.left(), interior.top(), |
291 interior.left(), interior.bottom()); | 294 interior.left(), interior.bottom()); |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 fBias, | 660 fBias, |
658 fTarget, | 661 fTarget, |
659 fTileMode, | 662 fTileMode, |
660 fConvolveAlpha); | 663 fConvolveAlpha); |
661 return true; | 664 return true; |
662 } | 665 } |
663 | 666 |
664 /////////////////////////////////////////////////////////////////////////////// | 667 /////////////////////////////////////////////////////////////////////////////// |
665 | 668 |
666 #endif | 669 #endif |
OLD | NEW |