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

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

Issue 11299262: ui: Use skia::RefPtr<T> for implicit safe reference counting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: winbuild Created 8 years 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/views/controls/menu/menu_image_util.cc ('k') | ui/views/painter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/progress_bar.cc
diff --git a/ui/views/controls/progress_bar.cc b/ui/views/controls/progress_bar.cc
index 1d7ad9d9d52d79aea4c4068891649ffce9d220cd..cab2991031bd004d1ab0e27587ee415a38c9385d 100644
--- a/ui/views/controls/progress_bar.cc
+++ b/ui/views/controls/progress_bar.cc
@@ -70,11 +70,9 @@ void FillRoundRect(gfx::Canvas* canvas,
} else {
p[1].iset(x, y + h);
}
- SkShader* s = SkGradientShader::CreateLinear(
- p, colors, points, count, SkShader::kClamp_TileMode, NULL);
- paint.setShader(s);
- // Need to unref shader, otherwise never deleted.
- s->unref();
+ skia::RefPtr<SkShader> s = skia::AdoptRef(SkGradientShader::CreateLinear(
+ p, colors, points, count, SkShader::kClamp_TileMode, NULL));
+ paint.setShader(s.get());
canvas->DrawPath(path, paint);
}
« no previous file with comments | « ui/views/controls/menu/menu_image_util.cc ('k') | ui/views/painter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698