add some asserts for mipmaps, and cleanup fFilterLevel if mipping failed
BUG=skia: R=scroggo@google.com, humper@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/240633003 git-svn-id: http://skia.googlecode.com/svn/trunk@14241 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
273a00d14f
commit
84f7a06ff9
@ -263,6 +263,7 @@ bool SkBitmapProcState::possiblyScaleImage() {
|
|||||||
if (mip) {
|
if (mip) {
|
||||||
fScaledCacheID = SkScaledImageCache::AddAndLockMip(fOrigBitmap,
|
fScaledCacheID = SkScaledImageCache::AddAndLockMip(fOrigBitmap,
|
||||||
mip);
|
mip);
|
||||||
|
SkASSERT(mip->getRefCnt() > 1);
|
||||||
mip->unref(); // the cache took a ref
|
mip->unref(); // the cache took a ref
|
||||||
SkASSERT(fScaledCacheID);
|
SkASSERT(fScaledCacheID);
|
||||||
}
|
}
|
||||||
@ -403,6 +404,12 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we are "still" kMedium_FilterLevel, then the request was not fulfilled by possiblyScale,
|
||||||
|
// so we downgrade to kLow (so the rest of the sniffing code can assume that)
|
||||||
|
if (SkPaint::kMedium_FilterLevel == fFilterLevel) {
|
||||||
|
fFilterLevel = SkPaint::kLow_FilterLevel;
|
||||||
|
}
|
||||||
|
|
||||||
bool trivialMatrix = (fInvMatrix.getType() & ~SkMatrix::kTranslate_Mask) == 0;
|
bool trivialMatrix = (fInvMatrix.getType() & ~SkMatrix::kTranslate_Mask) == 0;
|
||||||
bool clampClamp = SkShader::kClamp_TileMode == fTileModeX &&
|
bool clampClamp = SkShader::kClamp_TileMode == fTileModeX &&
|
||||||
SkShader::kClamp_TileMode == fTileModeY;
|
SkShader::kClamp_TileMode == fTileModeY;
|
||||||
|
Loading…
Reference in New Issue
Block a user