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

Unified Diff: chrome/common/badge_util.cc

Issue 122443005: replace deprecated SkScalarRound/Floor/Ceil calls with more explicit variants (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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 | « cc/output/software_renderer.cc ('k') | skia/ext/opacity_draw_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/badge_util.cc
diff --git a/chrome/common/badge_util.cc b/chrome/common/badge_util.cc
index 14210410e7c7735088ba4a532b1f199a41d159b0..349443dc500b20c8d48911d28b7df27e7020e903 100644
--- a/chrome/common/badge_util.cc
+++ b/chrome/common/badge_util.cc
@@ -109,7 +109,7 @@ SkBitmap DrawBadgeIconOverlay(const SkBitmap& icon,
SkScalar text_width = paint->measureText(badge_text.c_str(),
badge_text.size());
- if (SkScalarRound(text_width) > (icon.width() - kMinPadding * 2)) {
+ if (SkScalarRoundToInt(text_width) > (icon.width() - kMinPadding * 2)) {
// String is too large - use the alternate text.
badge_text = base::UTF16ToUTF8(fallback);
text_width = paint->measureText(badge_text.c_str(), badge_text.size());
@@ -119,7 +119,7 @@ SkBitmap DrawBadgeIconOverlay(const SkBitmap& icon,
// of pixels on each side as otherwise the text looks off-center. So if the
// padding would be uneven, clip one pixel off the right side.
int badge_width = icon.width();
- if ((SkScalarRound(text_width) % 1) != (badge_width % 1))
+ if ((SkScalarRoundToInt(text_width) % 1) != (badge_width % 1))
badge_width--;
// Render the badge bitmap and overlay into a canvas.
@@ -165,7 +165,7 @@ void PaintBadge(gfx::Canvas* canvas,
// Calculate text width. We clamp it to a max size.
SkScalar sk_text_width = text_paint->measureText(text.c_str(), text.size());
- int text_width = std::min(kMaxTextWidth, SkScalarFloor(sk_text_width));
+ int text_width = std::min(kMaxTextWidth, SkScalarFloorToInt(sk_text_width));
// Calculate badge size. It is clamped to a min width just because it looks
// silly if it is too skinny.
« no previous file with comments | « cc/output/software_renderer.cc ('k') | skia/ext/opacity_draw_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698