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

Unified Diff: src/core/SkBitmapProcState.cpp

Issue 240633003: add some asserts for mipmaps, and cleanup fFilterLevel if mipping failed (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcState.cpp
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index 8874e7b4452308e62bcb12e964f3e9d9660ce92f..1936f6a23bd384516aeaae8e20145a566912743e 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -263,6 +263,7 @@ bool SkBitmapProcState::possiblyScaleImage() {
if (mip) {
fScaledCacheID = SkScaledImageCache::AddAndLockMip(fOrigBitmap,
mip);
+ SkASSERT(mip->getRefCnt() > 1);
mip->unref(); // the cache took a ref
SkASSERT(fScaledCacheID);
}
@@ -403,6 +404,12 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) {
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 clampClamp = SkShader::kClamp_TileMode == fTileModeX &&
SkShader::kClamp_TileMode == fTileModeY;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698