Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Side by Side Diff: src/core/SkBitmapProcState.cpp

Issue 100473011: be more careful about OOB source pixels in the scanline rescaler, and (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: whitespace whoopsie Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/core/SkBitmapFilter.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698