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

Unified Diff: ui/views/painter.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/progress_bar.cc ('k') | ui/views/touchui/touch_selection_controller_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/painter.cc
diff --git a/ui/views/painter.cc b/ui/views/painter.cc
index 99c537c310344d2cc341dccbf99b1cfc65d02a98..85468d1ef1a376bde519a43f73f88426c4c0b8a0 100644
--- a/ui/views/painter.cc
+++ b/ui/views/painter.cc
@@ -48,12 +48,11 @@ class GradientPainter : public Painter {
else
p[1].iset(0, size.height());
- SkShader* s = SkGradientShader::CreateLinear(p, colors_.get(), pos_.get(),
- count_, SkShader::kClamp_TileMode, NULL);
+ skia::RefPtr<SkShader> s = skia::AdoptRef(SkGradientShader::CreateLinear(
+ p, colors_.get(), pos_.get(), count_, SkShader::kClamp_TileMode, NULL));
paint.setStyle(SkPaint::kFill_Style);
- paint.setShader(s);
+ paint.setShader(s.get());
// Need to unref shader, otherwise never deleted.
- s->unref();
canvas->sk_canvas()->drawRectCoords(SkIntToScalar(0), SkIntToScalar(0),
SkIntToScalar(size.width()),
« no previous file with comments | « ui/views/controls/progress_bar.cc ('k') | ui/views/touchui/touch_selection_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698