aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar humper <humper@google.com>2014-08-28 14:27:42 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-28 14:27:42 -0700
commitd73c169637f1ab0b96bae43269da7216bb93a7e1 (patch)
tree673a5affaf7d1db167e8f759b10b16bf3ecf9d35 /tests
parent0209e95cc2625a445c1cb6c4213d2182e5c832d7 (diff)
Second attempt to land the integral image scaling change.
Scale all images to the nearest rounded integer, and if there's still any scaling factor left over, pass it on to the subsequent bilerp code. Should avoid artifacts when tiling scaled images. Original CL received an LGTM from reed; new version disabled tiling in the downsamplebitmap GM; I verified that this fixes the issue we were seeing there on non-neon androids. BUG=skia:2888 R=reed@android.com TBR=reed Author: humper@google.com Review URL: https://codereview.chromium.org/514383003
Diffstat (limited to 'tests')
-rw-r--r--tests/ScaledImageCache.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/ScaledImageCache.cpp b/tests/ScaledImageCache.cpp
index 8088d093d3..b71c7443e5 100644
--- a/tests/ScaledImageCache.cpp
+++ b/tests/ScaledImageCache.cpp
@@ -17,7 +17,9 @@ static bool is_in_scaled_image_cache(const SkBitmap& orig,
SkScalar xScale,
SkScalar yScale) {
SkBitmap scaled;
- return SkBitmapCache::Find(orig, SkScalarInvert(xScale), SkScalarInvert(yScale), &scaled);
+ float roundedImageWidth = SkScalarRoundToScalar(orig.width() * xScale);
+ float roundedImageHeight = SkScalarRoundToScalar(orig.height() * xScale);
+ return SkBitmapCache::Find(orig, roundedImageWidth, roundedImageHeight, &scaled);
}
// Draw a scaled bitmap, then return true iff it has been cached.