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

Unified Diff: ui/views/painter.cc

Issue 9544001: ui: Let skia do the conversion work for us by using the integer version of set() function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: peter review Created 8 years, 10 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/controls/progress_bar.cc ('k') | ui/views/touchui/touch_selection_controller_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/painter.cc
diff --git a/ui/views/painter.cc b/ui/views/painter.cc
index 4a83cb4ae210eba2da865007033cdfcf489a817b..38e90d6ff0f69fc92ee1bad2e424ea175aeb8eed 100644
--- a/ui/views/painter.cc
+++ b/ui/views/painter.cc
@@ -33,15 +33,14 @@ class GradientPainter : public Painter {
virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) OVERRIDE {
SkPaint paint;
SkPoint p[2];
- p[0].set(SkIntToScalar(0), SkIntToScalar(0));
+ p[0].iset(0, 0);
if (horizontal_)
- p[1].set(SkIntToScalar(size.width()), SkIntToScalar(0));
+ p[1].iset(size.width(), 0);
else
- p[1].set(SkIntToScalar(0), SkIntToScalar(size.height()));
+ p[1].iset(0, size.height());
- SkShader* s =
- SkGradientShader::CreateLinear(p, colors_, NULL, 2,
- SkShader::kClamp_TileMode, NULL);
+ SkShader* s = SkGradientShader::CreateLinear(p, colors_, NULL, 2,
+ SkShader::kClamp_TileMode, NULL);
paint.setStyle(SkPaint::kFill_Style);
paint.setShader(s);
// Need to unref shader, otherwise never deleted.
« no previous file with comments | « ui/views/controls/progress_bar.cc ('k') | ui/views/touchui/touch_selection_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698