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

Unified Diff: ui/native_theme/native_theme_base.cc

Issue 11418217: Add skia::RefPtr class to wrap ref counted classes from Skia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Drop TNoRef 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
Index: ui/native_theme/native_theme_base.cc
diff --git a/ui/native_theme/native_theme_base.cc b/ui/native_theme/native_theme_base.cc
index fa6151fdff828bf944125ca58910f675d19b094b..98fcbf7130243fe296e35c5d156c6098ba188800 100644
--- a/ui/native_theme/native_theme_base.cc
+++ b/ui/native_theme/native_theme_base.cc
@@ -576,12 +576,11 @@ SkRect NativeThemeBase::PaintCheckboxRadioNewCommon(
else /* kNormal */
startEndColors = kCheckboxGradientColors;
SkColor colors[3] = {startEndColors[0], startEndColors[0], startEndColors[1]};
- SkShader* shader = SkGradientShader::CreateLinear(
+ skia::RefPtr<SkShader> shader = SkGradientShader::CreateLinear(
gradient_bounds, colors, NULL, 3, SkShader::kClamp_TileMode, NULL);
SkPaint paint;
paint.setAntiAlias(true);
- paint.setShader(shader);
- shader->unref();
+ paint.setShader(shader.get());
paint.setStyle(SkPaint::kFill_Style);
canvas->drawRoundRect(skrect, borderRadius, borderRadius, paint);
paint.setShader(NULL);
@@ -725,12 +724,11 @@ void NativeThemeBase::PaintButton(SkCanvas* canvas,
colors[0] = light_color;
colors[1] = base_color;
- SkShader* shader = SkGradientShader::CreateLinear(
+ skia::RefPtr<SkShader> shader = SkGradientShader::CreateLinear(
gradient_bounds, colors, NULL, 2, SkShader::kClamp_TileMode, NULL);
paint.setStyle(SkPaint::kFill_Style);
paint.setAntiAlias(true);
- paint.setShader(shader);
- shader->unref();
+ paint.setShader(shader.get());
canvas->drawRoundRect(skrect, SkIntToScalar(1), SkIntToScalar(1), paint);
paint.setShader(NULL);

Powered by Google App Engine
This is Rietveld 408576698