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

Unified Diff: ui/views/touchui/touch_selection_controller_impl.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/painter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/touchui/touch_selection_controller_impl.cc
diff --git a/ui/views/touchui/touch_selection_controller_impl.cc b/ui/views/touchui/touch_selection_controller_impl.cc
index 4b06e0945c9da42117676912e47122d45bd390e6..a6e151b685b065bea41fedf6f06ea838c90608ed 100644
--- a/ui/views/touchui/touch_selection_controller_impl.cc
+++ b/ui/views/touchui/touch_selection_controller_impl.cc
@@ -253,14 +253,15 @@ class TouchSelectionControllerImpl::TouchContextMenuView
points[0].iset(0, 0);
points[1].iset(0, height());
- SkShader* shader = SkGradientShader::CreateLinear(points,
- kGradientColors, kGradientPoints, arraysize(kGradientPoints),
- SkShader::kRepeat_TileMode);
+ skia::RefPtr<SkShader> shader = skia::AdoptRef(
+ SkGradientShader::CreateLinear(
+ points, kGradientColors, kGradientPoints,
+ arraysize(kGradientPoints),
+ SkShader::kRepeat_TileMode));
DCHECK(shader);
SkPaint paint;
- paint.setShader(shader);
- shader->unref();
+ paint.setShader(shader.get());
paint.setStyle(SkPaint::kFill_Style);
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
« no previous file with comments | « ui/views/painter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698