| 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 // but couldn't do it as a preprocess. Let's try to install | 402 // but couldn't do it as a preprocess. Let's try to install |
| 403 // the scanline version of the HQ sampler. If that process fails, | 403 // the scanline version of the HQ sampler. If that process fails, |
| 404 // downgrade to bilerp. | 404 // downgrade to bilerp. |
| 405 | 405 |
| 406 // NOTE: Might need to be careful here in the future when we want | 406 // NOTE: Might need to be careful here in the future when we want |
| 407 // to have the platform proc have a shot at this; it's possible that | 407 // to have the platform proc have a shot at this; it's possible that |
| 408 // the chooseBitmapFilterProc will fail to install a shader but a | 408 // the chooseBitmapFilterProc will fail to install a shader but a |
| 409 // platform-specific one might succeed, so it might be premature here | 409 // platform-specific one might succeed, so it might be premature here |
| 410 // to fall back to bilerp. This needs thought. | 410 // to fall back to bilerp. This needs thought. |
| 411 | 411 |
| 412 SkASSERT(fInvType > SkMatrix::kTranslate_Mask); | |
| 413 | |
| 414 if (!this->setBitmapFilterProcs()) { | 412 if (!this->setBitmapFilterProcs()) { |
| 415 fFilterLevel = SkPaint::kLow_FilterLevel; | 413 fFilterLevel = SkPaint::kLow_FilterLevel; |
| 416 } | 414 } |
| 417 } | 415 } |
| 418 | 416 |
| 419 if (SkPaint::kLow_FilterLevel == fFilterLevel) { | 417 if (SkPaint::kLow_FilterLevel == fFilterLevel) { |
| 420 // Only try bilerp if the matrix is "interesting" and | 418 // Only try bilerp if the matrix is "interesting" and |
| 421 // the image has a suitable size. | 419 // the image has a suitable size. |
| 422 | 420 |
| 423 if (fInvType <= SkMatrix::kTranslate_Mask || | 421 if (fInvType <= SkMatrix::kTranslate_Mask || |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 } else { | 981 } else { |
| 984 size >>= 2; | 982 size >>= 2; |
| 985 } | 983 } |
| 986 | 984 |
| 987 if (fFilterLevel != SkPaint::kNone_FilterLevel) { | 985 if (fFilterLevel != SkPaint::kNone_FilterLevel) { |
| 988 size >>= 1; | 986 size >>= 1; |
| 989 } | 987 } |
| 990 | 988 |
| 991 return size; | 989 return size; |
| 992 } | 990 } |
| OLD | NEW |