| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 SkScaledImageCache::Unlock(fScaledCacheID); | 163 SkScaledImageCache::Unlock(fScaledCacheID); |
| 164 fScaledCacheID = NULL; | 164 fScaledCacheID = NULL; |
| 165 // fall through to rebuild | 165 // fall through to rebuild |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 | 168 |
| 169 if (NULL == fScaledCacheID) { | 169 if (NULL == fScaledCacheID) { |
| 170 float dest_width = fOrigBitmap.width() / invScaleX; | 170 float dest_width = fOrigBitmap.width() / invScaleX; |
| 171 float dest_height = fOrigBitmap.height() / invScaleY; | 171 float dest_height = fOrigBitmap.height() / invScaleY; |
| 172 | 172 |
| 173 #ifdef SK_IGNORE_CORRECT_HIGH_QUALITY_IMAGE_SCALE | |
| 174 dest_width = SkScalarCeilToScalar(dest_width); | |
| 175 dest_height = SkScalarCeilToScalar(dest_height); | |
| 176 #endif | |
| 177 | |
| 178 // All the criteria are met; let's make a new bitmap. | 173 // All the criteria are met; let's make a new bitmap. |
| 179 | 174 |
| 180 SkConvolutionProcs simd; | 175 SkConvolutionProcs simd; |
| 181 sk_bzero(&simd, sizeof(simd)); | 176 sk_bzero(&simd, sizeof(simd)); |
| 182 this->platformConvolutionProcs(&simd); | 177 this->platformConvolutionProcs(&simd); |
| 183 | 178 |
| 184 if (!SkBitmapScaler::Resize(&fScaledBitmap, | 179 if (!SkBitmapScaler::Resize(&fScaledBitmap, |
| 185 fOrigBitmap, | 180 fOrigBitmap, |
| 186 SkBitmapScaler::RESIZE_BEST, | 181 SkBitmapScaler::RESIZE_BEST, |
| 187 dest_width, | 182 dest_width, |
| (...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 } else { | 1034 } else { |
| 1040 size >>= 2; | 1035 size >>= 2; |
| 1041 } | 1036 } |
| 1042 | 1037 |
| 1043 if (fFilterLevel != SkPaint::kNone_FilterLevel) { | 1038 if (fFilterLevel != SkPaint::kNone_FilterLevel) { |
| 1044 size >>= 1; | 1039 size >>= 1; |
| 1045 } | 1040 } |
| 1046 | 1041 |
| 1047 return size; | 1042 return size; |
| 1048 } | 1043 } |
| OLD | NEW |