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

Unified Diff: ash/wm/gestures/long_press_affordance_handler.cc

Issue 11414251: ash: Use skia::RefPtr to replace manual ref-counting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/gestures/long_press_affordance_handler.cc
diff --git a/ash/wm/gestures/long_press_affordance_handler.cc b/ash/wm/gestures/long_press_affordance_handler.cc
index 25d3a4dcea3a377590549efea307dc89751a3893..c66dbd3e7dab3e89ec9dc46943748be175afd671 100644
--- a/ash/wm/gestures/long_press_affordance_handler.cc
+++ b/ash/wm/gestures/long_press_affordance_handler.cc
@@ -105,22 +105,22 @@ void PaintAffordanceGlow(gfx::Canvas* canvas,
int radius = (end_radius + start_radius) / 2;
int glow_width = end_radius - start_radius;
sk_center.iset(center.x(), center.y());
- SkShader* shader = SkGradientShader::CreateTwoPointRadial(
- sk_center,
- SkIntToScalar(start_radius),
- sk_center,
- SkIntToScalar(end_radius),
- colors,
- pos,
- num_colors,
- SkShader::kClamp_TileMode);
+ skia::RefPtr<SkShader> shader = skia::AdoptRef(
+ SkGradientShader::CreateTwoPointRadial(
+ sk_center,
+ SkIntToScalar(start_radius),
+ sk_center,
+ SkIntToScalar(end_radius),
+ colors,
+ pos,
+ num_colors,
+ SkShader::kClamp_TileMode));
DCHECK(shader);
SkPaint paint;
paint.setStyle(SkPaint::kStroke_Style);
paint.setStrokeWidth(glow_width);
- paint.setShader(shader);
+ paint.setShader(shader.get());
paint.setAntiAlias(true);
- shader->unref();
SkPath arc_path;
arc_path.addArc(SkRect::MakeXYWH(center.x() - radius,
center.y() - radius,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698