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

Unified Diff: tests/SkResourceCacheTest.cpp

Issue 1320513005: simplify bitmap scaler and cache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 | « src/core/SkBitmapScaler.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SkResourceCacheTest.cpp
diff --git a/tests/SkResourceCacheTest.cpp b/tests/SkResourceCacheTest.cpp
index 6314863e503a487a349f1e0a0066deecc225691a..cf8327fcdeccd8b2d135bcfa5fae29da70fa7f87 100644
--- a/tests/SkResourceCacheTest.cpp
+++ b/tests/SkResourceCacheTest.cpp
@@ -21,9 +21,9 @@ static bool is_in_scaled_image_cache(const SkBitmap& orig,
SkScalar xScale,
SkScalar yScale) {
SkBitmap scaled;
- float roundedImageWidth = SkScalarRoundToScalar(orig.width() * xScale);
- float roundedImageHeight = SkScalarRoundToScalar(orig.height() * yScale);
- return SkBitmapCache::Find(orig, roundedImageWidth, roundedImageHeight, &scaled);
+ int width = SkScalarRoundToInt(orig.width() * xScale);
+ int height = SkScalarRoundToInt(orig.height() * yScale);
+ return SkBitmapCache::FindWH(orig, width, height, &scaled);
}
// Draw a scaled bitmap, then return true if it has been cached.
« no previous file with comments | « src/core/SkBitmapScaler.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698