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

Unified Diff: cc/tiles/software_image_decode_cache.cc

Issue 2870753002: SW Image Decode Cache Low to Medium Quality for Downscale (Closed)
Patch Set: rebaseline Created 3 years, 7 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 | cc/tiles/software_image_decode_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/software_image_decode_cache.cc
diff --git a/cc/tiles/software_image_decode_cache.cc b/cc/tiles/software_image_decode_cache.cc
index cc1f54fbda0c091f355f0c3a75c338d715879b3e..c41e24024e3d87acb48c2c6046e747fe6e196e79 100644
--- a/cc/tiles/software_image_decode_cache.cc
+++ b/cc/tiles/software_image_decode_cache.cc
@@ -921,14 +921,16 @@ ImageDecodeCacheKey ImageDecodeCacheKey::FromDrawImage(const DrawImage& image) {
// If we're not going to do a scale, we can use low filter quality. Note that
// checking if the sizes are the same is better than checking if scale is 1.f,
// because even non-1 scale can result in the same (rounded) width/height.
- // If either dimension is a downscale, then use mipmaps (medium filter
- // quality).
+ // If either dimension is a downscale, and the quality is not None (in which
+ // case we need to preserve the pixelated scale), then use mipmaps (medium
+ // filter quality).
if (target_size.width() == src_rect.width() &&
target_size.height() == src_rect.height()) {
quality = std::min(quality, kLow_SkFilterQuality);
- } else if (target_size.width() < src_rect.width() ||
- target_size.height() < src_rect.height()) {
- quality = std::min(quality, kMedium_SkFilterQuality);
+ } else if (quality != kNone_SkFilterQuality &&
+ (target_size.width() < src_rect.width() ||
+ target_size.height() < src_rect.height())) {
+ quality = kMedium_SkFilterQuality;
}
// Drop from high to medium if the the matrix we applied wasn't decomposable,
« no previous file with comments | « no previous file | cc/tiles/software_image_decode_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698