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

Unified Diff: ui/gfx/native_theme_chromeos.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/gfx/native_theme_base.cc ('k') | ui/gfx/skia_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..094ea0545e5eea91abea20e380ba8d7dd4e8f5e1 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),
@@ -691,10 +690,7 @@ void NativeThemeChromeos::PaintMenuPopupBackground(
paint.setStyle(SkPaint::kFill_Style);
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
- SkRect sk_rect;
- sk_rect.set(SkIntToScalar(0), SkIntToScalar(0),
- SkIntToScalar(rect.width()), SkIntToScalar(rect.height()));
- canvas->drawRect(sk_rect, paint);
+ canvas->drawRect(gfx::RectToSkRect(gfx::Rect(rect.size())), paint);
}
void NativeThemeChromeos::PaintProgressBar(SkCanvas* canvas,
« no previous file with comments | « ui/gfx/native_theme_base.cc ('k') | ui/gfx/skia_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698