Chromium Code Reviews| Index: ui/gfx/native_theme_chromeos.cc |
| diff --git a/ui/gfx/native_theme_chromeos.cc b/ui/gfx/native_theme_chromeos.cc |
| index 38ab1e51bcf27b029fbc381d5e780270c905daea..08393bbb40cf4ef6e7ede5887b07f59950f61aa7 100644 |
| --- a/ui/gfx/native_theme_chromeos.cc |
| +++ b/ui/gfx/native_theme_chromeos.cc |
| @@ -7,10 +7,10 @@ |
| #include "base/basictypes.h" |
| #include "base/logging.h" |
| #include "grit/gfx_resources.h" |
| -#include "third_party/skia/include/effects/SkGradientShader.h" |
| #include "third_party/skia/include/core/SkPaint.h" |
| #include "third_party/skia/include/core/SkPath.h" |
| #include "third_party/skia/include/core/SkShader.h" |
| +#include "third_party/skia/include/effects/SkGradientShader.h" |
| #include "ui/base/resource/resource_bundle.h" |
| #include "ui/gfx/insets.h" |
| #include "ui/gfx/rect.h" |
| @@ -137,8 +137,8 @@ void GetGradientPaintForRect(const gfx::Rect& rect, |
| paint->setAntiAlias(true); |
| SkPoint points[2]; |
| - points[0].set(SkIntToScalar(rect.x()), SkIntToScalar(rect.y())); |
| - points[1].set(SkIntToScalar(rect.x()), SkIntToScalar(rect.bottom())); |
| + points[0].iset(rect.x(), rect.y()); |
| + points[1].iset(rect.x(), rect.bottom()); |
| SkShader* shader = SkGradientShader::CreateLinear(points, |
| colors, stops, count, SkShader::kClamp_TileMode); |
| @@ -226,8 +226,8 @@ void GetRadioIndicatorGradientPaint(const gfx::Rect bounds, |
| paint->setAntiAlias(true); |
| SkPoint points[2]; |
| - points[0].set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y())); |
| - points[1].set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.bottom())); |
| + points[0].iset(bounds.x(), bounds.y()); |
| + points[1].iset(bounds.x(), bounds.bottom()); |
| static const SkScalar kGradientPoints[2] = { |
| SkIntToScalar(0), |
| @@ -589,12 +589,11 @@ void NativeThemeChromeos::PaintTextField(SkCanvas* canvas, |
| }; |
| SkPoint points[2]; |
| - points[0].set(SkIntToScalar(rect.x()), SkIntToScalar(rect.y())); |
| - points[1].set(SkIntToScalar(rect.x()), SkIntToScalar(rect.bottom())); |
| + points[0].iset(rect.x(), rect.y()); |
| + points[1].iset(rect.x(), rect.bottom()); |
| - GetGradientPaintForRect(rect, |
| - gradient_colors, gradient_points, arraysize(gradient_points), |
| - &fill_paint); |
| + GetGradientPaintForRect(rect, gradient_colors, gradient_points, |
| + arraysize(gradient_points), &fill_paint); |
| } |
| SkPath border; |
| @@ -676,8 +675,8 @@ void NativeThemeChromeos::PaintMenuPopupBackground( |
| }; |
| SkPoint points[2]; |
| - points[0].set(SkIntToScalar(0), SkIntToScalar(0)); |
| - points[1].set(SkIntToScalar(0), SkIntToScalar(rect.height())); |
| + points[0].iset(0, 0); |
| + points[1].iset(0, rect.height()); |
| SkShader* shader = SkGradientShader::CreateLinear(points, |
| kGradientColors, kGradientPoints, arraysize(kGradientPoints), |
| @@ -692,8 +691,7 @@ void NativeThemeChromeos::PaintMenuPopupBackground( |
| paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
| SkRect sk_rect; |
|
Peter Kasting
2012/02/29 20:40:31
Nit: Shorter:
canvas->drawRect(gfx::RectToSkRec
tfarina
2012/02/29 22:42:14
Done.
|
| - sk_rect.set(SkIntToScalar(0), SkIntToScalar(0), |
| - SkIntToScalar(rect.width()), SkIntToScalar(rect.height())); |
| + sk_rect.iset(0, 0, rect.width(), rect.height()); |
| canvas->drawRect(sk_rect, paint); |
| } |