summaryrefslogtreecommitdiffstats
path: root/ui/gfx/native_theme_android.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-01 16:29:21 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-01 16:29:21 +0000
commitb9857bdd37282ba346cbb2ccb52b67175ef490c0 (patch)
tree373a6f5904ab4e71c7b407a26512267f0c7b109c /ui/gfx/native_theme_android.cc
parent414d57a780c0f774a9e5c2a893f5189b88b43b6e (diff)
downloadchromium_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/gfx/native_theme_android.cc')
-rw-r--r--ui/gfx/native_theme_android.cc23
1 files changed, 8 insertions, 15 deletions
diff --git a/ui/gfx/native_theme_android.cc b/ui/gfx/native_theme_android.cc
index 82c5ab4..a63f37a 100644
--- a/ui/gfx/native_theme_android.cc
+++ b/ui/gfx/native_theme_android.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -345,10 +345,8 @@ void NativeThemeAndroid::PaintButton(SkCanvas* canvas,
int kLightEnd = state == PRESSED ? 1 : 0;
int kDarkEnd = !kLightEnd;
SkPoint gradient_bounds[2];
- gradient_bounds[kLightEnd].set(SkIntToScalar(rect.x()),
- SkIntToScalar(rect.y()));
- gradient_bounds[kDarkEnd].set(SkIntToScalar(rect.x()),
- SkIntToScalar(kBottom - 1));
+ gradient_bounds[kLightEnd].iset(rect.x(), rect.y());
+ gradient_bounds[kDarkEnd].iset(rect.x(), kBottom - 1);
SkColor colors[2];
colors[0] = light_color;
colors[1] = base_color;
@@ -614,20 +612,15 @@ void NativeThemeAndroid::PaintProgressBar(
int dest_left_border_width = static_cast<int>(left_border_image->width() *
tile_scale);
- SkRect dest_rect = {
- SkIntToScalar(rect.x()),
- SkIntToScalar(rect.y()),
- SkIntToScalar(rect.x() + dest_left_border_width),
- SkIntToScalar(rect.bottom())
- };
+ SkRect dest_rect;
+ dest_rect.iset(rect.x(), rect.y(), rect.x() + dest_left_border_width,
+ rect.bottom());
canvas->drawBitmapRect(*left_border_image, NULL, dest_rect);
int dest_right_border_width = static_cast<int>(right_border_image->width() *
tile_scale);
- dest_rect.set(SkIntToScalar(rect.right() - dest_right_border_width),
- SkIntToScalar(rect.y()),
- SkIntToScalar(rect.right()),
- SkIntToScalar(rect.bottom()));
+ dest_rect.iset(rect.right() - dest_right_border_width, rect.y(), rect.right(),
+ rect.bottom());
canvas->drawBitmapRect(*right_border_image, NULL, dest_rect);
}