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

Unified Diff: ui/views/controls/progress_bar.cc

Issue 1135263002: stop using (deprecated) SkScalarDiv (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « ui/views/color_chooser/color_chooser_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/progress_bar.cc
diff --git a/ui/views/controls/progress_bar.cc b/ui/views/controls/progress_bar.cc
index 0d6ed17f5e0dbc304b97794c31ed32abd8669abd..d8fe31fab5b5388c1b8761ffc8205a1408739ae2 100644
--- a/ui/views/controls/progress_bar.cc
+++ b/ui/views/controls/progress_bar.cc
@@ -239,9 +239,8 @@ void ProgressBar::OnPaint(gfx::Canvas* canvas) {
};
// We want a thin 1-pixel line for kBarTopColor.
SkScalar scalar_height = SkIntToScalar(bar_height);
- SkScalar highlight_width = SkScalarDiv(SK_Scalar1, scalar_height);
- SkScalar border_width = SkScalarDiv(SkIntToScalar(kBorderWidth),
- scalar_height);
+ SkScalar highlight_width = 1 / scalar_height;
+ SkScalar border_width = kBorderWidth / scalar_height;
sky 2015/05/12 15:46:54 SKIntToScale(kBorderWidth) here and 286?
const SkScalar bar_points[] = {
0,
border_width,
@@ -284,9 +283,7 @@ void ProgressBar::OnPaint(gfx::Canvas* canvas) {
kBarHighlightEnd,
};
const SkScalar highlight_points[] = {
- 0,
- SK_Scalar1 - SkScalarDiv(SkIntToScalar(kBorderWidth), scalar_height),
- SK_Scalar1,
+ 0, SK_Scalar1 - kBorderWidth / scalar_height, SK_Scalar1,
};
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
« no previous file with comments | « ui/views/color_chooser/color_chooser_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698