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

Unified Diff: src/core/SkBitmapProcState.cpp

Issue 196413009: remove SK_SUPPORT_LEGACY_COPYTO_CONFIG (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..ed02afe8933febbb0d4bcc5be44782c0dcd0a591 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);
}
@@ -383,6 +384,7 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) {
fBitmap = NULL;
fInvMatrix = inv;
fFilterLevel = paint.getFilterLevel();
+// fFilterLevel = SkPaint::kMedium_FilterLevel;
SkASSERT(NULL == fScaledCacheID);
@@ -403,6 +405,12 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) {
return false;
}
+ // If we are "still" kMedium_FilterLeve, then then 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