From b9857bdd37282ba346cbb2ccb52b67175ef490c0 Mon Sep 17 00:00:00 2001 From: "tfarina@chromium.org" Date: Thu, 1 Mar 2012 16:29:21 +0000 Subject: ui: Let skia do the conversion work for us by using the integer version of set() function. R=pkasting@chromium.org TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/9544001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124416 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/views/painter.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'ui/views/painter.cc') diff --git a/ui/views/painter.cc b/ui/views/painter.cc index 4a83cb4..38e90d6 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. -- cgit v1.1