diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-01 16:29:21 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-01 16:29:21 +0000 |
commit | b9857bdd37282ba346cbb2ccb52b67175ef490c0 (patch) | |
tree | 373a6f5904ab4e71c7b407a26512267f0c7b109c /ui/views/painter.cc | |
parent | 414d57a780c0f774a9e5c2a893f5189b88b43b6e (diff) | |
download | chromium_src-b9857bdd37282ba346cbb2ccb52b67175ef490c0.zip chromium_src-b9857bdd37282ba346cbb2ccb52b67175ef490c0.tar.gz chromium_src-b9857bdd37282ba346cbb2ccb52b67175ef490c0.tar.bz2 |
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
Diffstat (limited to 'ui/views/painter.cc')
-rw-r--r-- | ui/views/painter.cc | 11 |
1 files changed, 5 insertions, 6 deletions
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. |