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

Unified Diff: cc/tiles/software_image_decode_controller.cc

Issue 2361243002: cc: Use medium filter quality for downscales. (Closed)
Patch Set: update Created 4 years, 3 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_controller_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_controller.cc
diff --git a/cc/tiles/software_image_decode_controller.cc b/cc/tiles/software_image_decode_controller.cc
index be626eb53e490edd03f8fda131da0c912a5be9ec..ce7ca8e2d6f7ce9bcffb2b177d41224e02dafa3c 100644
--- a/cc/tiles/software_image_decode_controller.cc
+++ b/cc/tiles/software_image_decode_controller.cc
@@ -860,9 +860,14 @@ ImageDecodeControllerKey ImageDecodeControllerKey::FromDrawImage(
// 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 (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);
}
// 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_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698