| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "SkBitmapProcState.h" | 8 #include "SkBitmapProcState.h" |
| 9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
| 10 #include "SkFilterProc.h" | 10 #include "SkFilterProc.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 this->platformConvolutionProcs(&simd); | 143 this->platformConvolutionProcs(&simd); |
| 144 | 144 |
| 145 if (!SkBitmapScaler::Resize(&fScaledBitmap, | 145 if (!SkBitmapScaler::Resize(&fScaledBitmap, |
| 146 fOrigBitmap, | 146 fOrigBitmap, |
| 147 SkBitmapScaler::RESIZE_BEST, | 147 SkBitmapScaler::RESIZE_BEST, |
| 148 dest_width, | 148 dest_width, |
| 149 dest_height, | 149 dest_height, |
| 150 simd)) { | 150 simd)) { |
| 151 // we failed to create fScaledBitmap, so just return and let | 151 // we failed to create fScaledBitmap, so just return and let |
| 152 // the scanline proc handle it. | 152 // the scanline proc handle it. |
| 153 return true; | 153 return false; |
| 154 | 154 |
| 155 } | 155 } |
| 156 fScaledCacheID = SkScaledImageCache::AddAndLock(fOrigBitmap, | 156 fScaledCacheID = SkScaledImageCache::AddAndLock(fOrigBitmap, |
| 157 invScaleX, | 157 invScaleX, |
| 158 invScaleY, | 158 invScaleY, |
| 159 fScaledBitmap); | 159 fScaledBitmap); |
| 160 } | 160 } |
| 161 fScaledBitmap.lockPixels(); // wonder if Resize() should have locked thi
s | 161 fScaledBitmap.lockPixels(); // wonder if Resize() should have locked thi
s |
| 162 fBitmap = &fScaledBitmap; | 162 fBitmap = &fScaledBitmap; |
| 163 | 163 |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 } else { | 968 } else { |
| 969 size >>= 2; | 969 size >>= 2; |
| 970 } | 970 } |
| 971 | 971 |
| 972 if (fFilterLevel != SkPaint::kNone_FilterLevel) { | 972 if (fFilterLevel != SkPaint::kNone_FilterLevel) { |
| 973 size >>= 1; | 973 size >>= 1; |
| 974 } | 974 } |
| 975 | 975 |
| 976 return size; | 976 return size; |
| 977 } | 977 } |
| OLD | NEW |