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

Unified Diff: ui/views/controls/glow_hover_controller.cc

Issue 9588003: browser: Minor changes to use SkPoint::iset() function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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/render_text.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/glow_hover_controller.cc
diff --git a/ui/views/controls/glow_hover_controller.cc b/ui/views/controls/glow_hover_controller.cc
index 24e5f405948411c56e00d5795e475b24c7444aac..4274508a227e8381574737b57195618bbeaaaac2 100644
--- a/ui/views/controls/glow_hover_controller.cc
+++ b/ui/views/controls/glow_hover_controller.cc
@@ -75,25 +75,21 @@ void GlowHoverController::Draw(gfx::Canvas* canvas,
// Draw a radial gradient to hover_canvas.
int radius = view_->width() / 3;
- SkPaint paint;
- paint.setStyle(SkPaint::kFill_Style);
- paint.setFlags(SkPaint::kAntiAlias_Flag);
- SkPoint loc = { SkIntToScalar(location_.x()), SkIntToScalar(location_.y()) };
+ SkPoint center_point;
+ center_point.iset(location_.x(), location_.y());
SkColor colors[2];
int hover_alpha =
static_cast<int>(255 * kOpacityScale * animation_.GetCurrentValue());
colors[0] = SkColorSetARGB(hover_alpha, 255, 255, 255);
colors[1] = SkColorSetARGB(0, 255, 255, 255);
- SkShader* shader = SkGradientShader::CreateRadial(
- loc,
- SkIntToScalar(radius),
- colors,
- NULL,
- 2,
- SkShader::kClamp_TileMode);
+ SkShader* shader = SkGradientShader::CreateRadial(center_point,
+ SkIntToScalar(radius), colors, NULL, 2, SkShader::kClamp_TileMode);
// Shader can end up null when radius = 0.
// If so, this results in default full tab glow behavior.
if (shader) {
+ SkPaint paint;
+ paint.setStyle(SkPaint::kFill_Style);
+ paint.setAntiAlias(true);
paint.setShader(shader);
shader->unref();
hover_canvas.DrawRect(gfx::Rect(location_.x() - radius,
« no previous file with comments | « ui/gfx/render_text.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698